npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@devskin-labs/agent

v1.1.0

Published

DevSkin APM Agent - Application Performance Monitoring for Node.js

Readme

@devskin/agent

DevSkin APM Agent - Application Performance Monitoring for Node.js

Installation

npm install @devskin/agent

Quick Start

1. Initialize the Agent

Initialize the agent before other imports in your application entry point:

// app.js or index.js
const { init, startAgent, expressMiddleware } = require('@devskin/agent');

const agent = init({
  serverUrl: 'https://admin-monitoring.devskin.com',
  apiKey: 'your-api-key',
  serviceName: 'my-service',
  environment: process.env.NODE_ENV || 'production',

  // Optional configuration
  sampleRate: 1.0,        // Sample 100% of traces
  instrumentHttp: true,   // Auto-instrument HTTP calls
  instrumentExpress: true,// Auto-instrument Express
  debug: false
});

// Start the agent
await startAgent();

2. Add Express Middleware

const express = require('express');
const { expressMiddleware } = require('@devskin/agent');

const app = express();

// Add APM middleware (captures all routes automatically)
app.use(expressMiddleware(agent));

app.get('/api/users', async (req, res) => {
  // This request is automatically traced!
  const users = await db.query('SELECT * FROM users');
  res.json(users);
});

app.listen(3000);

Manual Span Creation

For custom business logic tracing:

const { SpanBuilder, SpanKind } = require('@devskin/agent');

async function processOrder(orderId) {
  const agent = getAgent();
  const span = agent.createSpan('processOrder', SpanKind.INTERNAL);

  span.setAttribute('order.id', orderId);

  try {
    const order = await db.query('SELECT * FROM orders WHERE id = $1', [orderId]);
    span.setAttribute('order.amount', order.amount);
    span.setOk();
    return order;
  } catch (error) {
    span.recordError(error);
    throw error;
  } finally {
    span.end();
  }
}

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | serverUrl | string | Required | DevSkin server URL | | apiKey | string | Required | API key for authentication | | serviceName | string | Required | Name of your service | | serviceVersion | string | '1.0.0' | Version of your service | | environment | string | 'production' | Environment name | | sampleRate | number | 1.0 | Sampling rate (0.0 to 1.0) | | instrumentHttp | boolean | true | Auto-instrument HTTP calls | | instrumentExpress | boolean | true | Auto-instrument Express | | debug | boolean | false | Enable debug logging | | flushInterval | number | 5000 | Interval to flush spans (ms) | | maxBatchSize | number | 100 | Max spans per batch |

Middleware Options

app.use(expressMiddleware(agent, {
  // Paths to ignore
  ignorePaths: ['/health', '/metrics'],
  
  // Custom request hook
  requestHook: (span, req) => {
    span.setAttribute('user.id', req.user?.id);
  },
  
  // Custom response hook
  responseHook: (span, req, res) => {
    span.setAttribute('response.cached', res.getHeader('X-Cache') === 'HIT');
  }
}));

Span Kinds

| Kind | Description | |------|-------------| | SpanKind.INTERNAL | Internal operation | | SpanKind.SERVER | Server-side handling of a request | | SpanKind.CLIENT | Client-side HTTP request | | SpanKind.PRODUCER | Message producer | | SpanKind.CONSUMER | Message consumer |

Distributed Tracing

The agent automatically propagates trace context via W3C Trace Context headers:

  • traceparent: Standard W3C header for trace propagation
  • x-devskin-trace-id: DevSkin custom header

API Reference

init(config)

Initialize the agent with configuration. Returns the agent instance.

startAgent()

Start the agent and begin collecting traces. Returns a Promise.

stopAgent()

Stop the agent and flush remaining data. Returns a Promise.

getAgent()

Get the current agent instance. Returns null if not initialized.

expressMiddleware(agent, options)

Create Express middleware for automatic request tracing.

agent.createSpan(name, kind, parentSpan)

Create a new span for custom tracing.

agent.recordMetric(name, value, tags)

Record a custom metric.

License

MIT