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-fetch

v0.0.9

Published

Fetch an npm module as a tarball

Readme

npm-fetch

Fetch npm modules. This is a work in progress.

Build Status Dependency Status NPM version

Usage

var fetch = require('npm-fetch');
fetch('[email protected]', __dirname + '/npm-fetch.tgz', function (err) {
  if (err) throw err;
})

API

fetch(name, spec, dest, options, cb)

UNSTABLE

Fetch the package as a tarball to destination using the appropriate method.

  • name the name of the package as a string
  • spec a string which can be:
    • a version, version range or tag if the module is in the npm repository
    • a url with https or http as the scheme, where the module is hosted somewhere as a tarball
    • a git url, where the module will be cloned as a git repository
    • a GitHub specifier of the form username/reponame#tag-name where #tag-name is optional and defaults to #master
    • a path to a local file or folder

npm.version(name, version, options)

Download package at exact version and return a stream.

npm.range(name, versionRange, options)

Download the max satisfying version of a package

npm.tag(name, tag, options)

Download the package name at tag and return a stream

github(name, 'user/repo#tag', options)

Returns a stream for the GitHub repo as a tarball at the given tag (defaults to master)

e.g.

fetch.github('npm-fetch', 'ForbesLindesay/npm-fetch', {})
  .pipe(fs.createWriteStream('npm-fetch.tar.gz'))

git(name, url, options)

Not yet implemented

tarball(name, url, options)

Get a stream for a tarball (handling redirects and retries).

local.dir(name, path, options)

Package up the directory at path and return a stream for the tarball.

local.file(name, path, options)

Just create a read stream for path

License

BSD