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

stats-page

v0.1.0

Published

Create a /stats page http-server for a server application

Readme

Stats Server for Node Applications

Create a /stats page http-server for a server application

Fire up an http server that you can query for stats on a running node process

Usage

var stats_page = require('stats-page');
stats_page.listen(port, [host], [callback]);

Example

To create a stats server for your application use the following code

var stats_page = require('stats-page').listen(8745);

This will fire up a stats server on port 8745 that you can query

$ curl -sS localhost:8745/ | json
[
  "ping",
  "process",
  "stats"
]

This returns the next route you can query

$ curl -sS localhost:8745/process | json
[
  "arch",
  "argv",
  "cwd",
  "env",
  "execPath",
  "features",
  "getgid",
  "getuid",
  "memoryUsage",
  "pid",
  "platform",
  "uptime",
  "uvCounters",
  "version",
  "versions"
]

Then drill in further to get some meaningful information

$ curl -sS localhost:8745/process/argv | json
[
  "node",
  "/Users/dave/dev/node-stats-page/examples/simple.js"
]
$ curl -sS localhost:8745/process/memoryUsage | json
{
  "rss": 14368768,
  "heapTotal": 5343936,
  "heapUsed": 2799240
}
$ curl -sS localhost:8745/process/uptime | json
32
$ curl -sS localhost:8745/process/version | json
v0.6.15
$ curl -sS localhost:8745/ping | json
pong

NOTE: stats-page will listen on 0.0.0.0 by default (as does http.createServer), you can specify a second argument to the start method of 'localhost' to restrict access.

Customization

You will no doubt have information specific to your app that you would like to expose. You can add your own routes using the addRoute function

stats_page.router.addRoute('/custom', function(req, res) {
  res.end('My Custom Route');
});

then when you query

curl -sS localhost:8745/custom | json
My Custom Route

you will get your data

The addRoute function is provided by the routes module

Install

npm install stats-page

FAQ

Are there any other meaningful routes than /process ?

process had the easiest stats to expose. If you have any more stats that are generic enough to expose fork and make a pull request.

Does this work with connect/middle-ware/express/some framework?

I don't know.

Is this information safe to leave exposed?

Short answer: no. Process information like this can be a security concern, especially having information like ENV variables visible. It's your job to make sure this host is properly ACL'd if exposed externally, or to lock this down to localhost.

License

MIT Licensed