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 🙏

© 2025 – Pkg Stats / Ryan Hefner

npeatea

v1.8.3

Published

Tool for browsing your NPM dependencies in a tree structure and inspecting registry information about them

Readme

nPeaTea - Node.js Local Package Traverser

A visualization of NPMAPI that allows you to browse local projects on a node server based on the configuration file npmlpb.json as supported by NPMAPI.

NPMAPI is configured via an npmlpb.json file in ther server root directory which defines your projects root directory as well as specific project directories you are interested in browsing via the API.

NPM Local Package Traverser (NPT) runs as a node.js webserver serving pages and assets, responding to API requests, and providing a socket.io interface to provide for real-time updates when something relevant changes in the projects being observed.

You can integrate the NPT into your own projects using the exported API processRequest. You can also enable real time updates to reflect changes by providing a socket port using setSocketPort.

Installation

If you are going to run the application directly, simply install the module as a top-level project. If you want to integrate this into your own application (i.e. admin application for your project), then install as a dependency module in your project directory.

npm install npeatea

npmlpb.json configuration file

This is the config file used for specifying scannable projects, or your root project directory (will scan all sub-directories) A sample file npmlpb.json is included in the install package This file must be placed in the application directory where npeatea is installed (where index.js is located)

{
  "projects_rootdir" : "../", 
  "projects" : [         
           {"name" : "npm", "path": "node_modules/npm/"},
           {"name" : "columnify", "path": "node_modules/npm/node_modules/columnify/"}
         ]
}

Running the application

The webserver by default is set to run on ports 1337 (web) and 1338 (socket). You can change these settings by editing the index.js wrapper file directly. To start the server, just enter:

node index.js

This will start the server and the socket listener. Next, using a modern browser (webkit preferred) navigate to

<hostname>:1337/npmapi/index.html

If you are testing this locally, then simply use "localhost" for the hostname.

Usage

There are 2 primary UI controls to use, the project select list, and the dependency tree. The project select list in the upper left corner will show you the valid projects that were found based on the npmlpb.json configuration (a valid project with dependencies will have a package.json and a node_modules directory). Click on the select list, and choose which package you want to view.

The tree list is what you use to browse the dependency tree. The project selected is at the root of the tree. You can click the small triangle icons on the list to open up the subtree below any particular level. When you select a package, it will load that package's information in the right side panel. The application prioritizes any local information for presentation (package.json, README.md, etc.), but will fetch data directly from npmjs.org if necessary. Note, there is no API available to fetch README file information from npmjs.org, so only the package.json can be retrieved. (This is one of many reasons I wrote NPMAPI).

Use the tabs at the top of the content pane to switch between viewing the README and the package.json. For the README, if a readmeFilename is specified in the package.json, NPMAPI will load that file and return it for viewing, and will ignore any content that might be specified in the readme property in package.json.

Integrating into your own application

You can integrate NPT into your own application powered by node.js by leveraging the API exposed in req-handler.js. The basic idea is to route any /npmapi requests to the provided request handler. You can inspect the index.js file to see a basic example:

var express = require('express');
var npt = require('./req-handler.js');

var app = express();

npt.setSocketPort(1338);
npt.setFSPollingRate(10);  // in seconds

app.get ('/npmapi/*', function(req,res) {
  // process requests intended for npmapi
  return npt.processRequest(req,res);
});

app.listen(1337);
console.log('Server running at http://<host>:1337/ : nPeaTea socket on port <host>:1338');

In your own application, you need would set up the socket using setSocketPort, and set the polling rate (how often the server will inspect the file structure for changes) in seconds using setFSPollingRate

In your own webserver (whether you are using express or not), simply route any /npmapi/* calls to processRequest which will handle it from there.

License

The MIT License (MIT)

Copyright (c) 2014, Ask.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.