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

npm-verify-stream

v1.3.1

Published

A duplex stream for receiving a package tarball, verifying arbitrary checks, and emitting that same tarball on success.

Downloads

44

Readme

npm-verify-stream

A duplex stream for receiving a package tarball, verifying arbitrary checks, and emitting that same tarball on success.

Usage

var VerifyStream = ('npm-verify-stream');
var fs = require('fs');
var request = require('request');

//
// Create our verifier
//
var verifier = new VerifyStream({
  log: console.log,
  checks: [
    //
    // A set of checks to run on a fully read npm package
    // See [Checks] below.
    //
  ]
});

//
// Put the tarball somewhere (like npm) ONLY if it passes
// all of the checks.
//
fs.createReadStream('npm-verify-stream-0.0.0.tgz')
  .pipe(verifier)
  .pipe(request.post('https://registry.nodejitsu.com/npm-verify-stream'));

Checks

A "check" is a function that accepts an npm-package-buffer and responds with either no error or an error indicating how the package violated the check.

example-check.js

module.exports = function (version, done) {
  //
  // `version.package` is a fully JSON parsed the package.json.
  //
  console.dir(version.package);

  //
  // `version.files` is all files read into memory
  //
  console.dir(version.files);

  //
  // Respond when done
  //
  done();
};

API

See also: npm-package-buffer, tar-buffer.

Options

  • checks: (required) Check functions that must pass to consider the package verified.
  • concurrency: (default: 5) Number of concurrent checks to run.
  • log: (optional) Log function to use. Expects console.log API.
  • read: (optional) Options to pass to the TarBuffer.
  • before: (optional) Stream to pipe to BEFORE piping to the zlib.Unzip and tar.Parse streams.
  • cleanup: (optional) If explicitly set to false then temporary files will not be cleaned up. Useful for debugging.

Events

  • error: as with any stream these will be emitted if the readable or writable end of the duplex stream has errored. It will also be emitted if there is an error writing the tarball to the disk cache during the verification process or if the verification fails.
  • cleanup: emitted when the cached tarball is removed.
verifier.on('cleanup', function (file, err) {
  // If there was an error removing from your cache
  // it will be here. ENOENT errors are ignored.
});
Author: Charlie Robbins
LICENSE: MIT