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

strossle-metrics

v0.2.1

Published

A metrics logging framework

Readme

Metrics

How do I use this?

const Metrics = require('metrics');
const { LogstashJSON } = Metrics.Formatter;
const { Udp } = Metrics.Output;
const { ApplicationVersion, Node, Rancher } = Metrics.Plugin;

const metrics = new Metrics({ formatter: new Metrics.Formatter.InfluxdbLineProtocol(), output: new Metrics.Output.Stdout() });

metrics.send('measurement_name', { a: 1, b: true, c: 'Hello' });
metrics.send('measurement_2', { a: 10.0 }, { tags: { host: 'aaaaa' }, timestamp: Date.now() * 1e6 });

const metricsWithPlugins = new Metrics()
	.setFormatter(new Metrics.Formatter.LogstashJSON())
	.setOutput(new Metrics.Output.Stdout())
	.addPlugin(new Metrics.Plugin.ApplicationVersion())
	.addPlugin(new Metrics.Plugin.Node());

metricsWithPlugins.send('measurement_3', { a: 1 });
// {"measurement":"measurement_3","a":1,"node_version":"v6.3.0","npm_version":"0.0.1"}

// Example of setup in production
const metrics2 = new Metrics()
	.setFormatter(new LogstashJSON())
	.setOutput(new Udp('udp4://wherever.you.send.your.metrics.org:12345'))
	.addPlugin(new ApplicationVersion())
	.addPlugin(new Node())
	.addPlugin(new Rancher({
		metadata: [
			Rancher.CONTAINER,
			Rancher.SERVICE,
			Rancher.STACK,
		],
	}));

Plugins

Application Version

Adds the version found in the package.json file of the current working directory to metrics.

Node Version

Adds the node version as reported by process.version to metrics.

Rancher

Uses the Rancher metadata service to add stack, service, container and host information to metrics.

Changelog

| Version | Description | | ----------- | --------------------------- | | 0.2.1 | Remove unused dependency | | 0.2.0 | Rename Npm plugin to ApplicationVersion | | 0.1.4 | Make it easier to configure Rancher metadata. Use request instead of fetch since fetch caused issues in some test frameworks because of global variables | | 0.1.3 | Get envrionment from rancher metadata service | | 0.1.2 | Add basic logging | | 0.1.1 | Fix timestamps for logstash json, update readme | | 0.1.0 | Add basic plugin support, for Rancher, Node and Npm information | | 0.0.2 | Add support for JSON formatter | | 0.0.1 | Support for InfluxdbLineProtocol and TCP/UDP output |