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

index-webpack-plugin

v0.0.0

Published

WIP

Readme

bundle-dependencies

NPM version Travis build status js-canonical-style

Deprecated

The original benchmarks of bundledDependencies have been flawed.

To achieve the same result of bundle-dependencies using bundledDependencies package.json property:

  1. Add all dependencies to bundledDependencies package.json property.
  2. Before publishing, start in clean directory (i.e., rm -fr ./node_modules).
  3. Install dependencies using --production flag (i.e., npm install --production).
  4. Publish package.

You can use bundled-dependencies package to automate the first step.

npm install bundled-dependencies --save-dev

Add to package.json:

{
    "scripts": {
        "bundle-dependencies": "bundled-dependencies"
    }
}

Run:

npm run bundle-dependencies

bundle-dependencies

Bundles (deep) all module dependencies into a monolithic NPM package.

bundle-dependencies is designed to be used with devDependencies and modules installed using --global flag.

How much time can it save? Lets see.

2.3.63 release is done without bundle-dependencies.

time npm install [email protected]

34.59s user
6.15s system
24% cpu
2:44.35 total

2.3.64 release is done with bundle-dependencies.

time npm install [email protected]

5.41s user
2.34s system
36% cpu
21.175 total

The bundle-dependencies install process is 8 times faster (2 minutes 44 seconds compared to 21 second).

Usage

npm install bundle-dependencies --save-dev

Add to package.json:

{
    "scripts": {
        "publish-bundle": "bundle-dependencies publish"
    }
}

To publish your package with bundled dependencies, run:

npm run publish-bundle

.npmignore

Add to .npmignore (and .gitignore):

.backup.package.json
.backup.node_modules

These are the backup files of your original ./package.json and ./node_modules. Do not commit them to the package registry.

Considerations

  • This tool will not work if package has dependencies with native bindings (Issues #1 and #2).

Implementation

bundle-dependencies publish execution flow is:

  1. Runs bundle-dependencies internal prepublish logic.
  2. Executes npm publish.
  3. Runs bundle-dependencies internal postpublish logic.

Do not add bundle-dependencies script to prepublish, publish or postpublish package.json scripts. NPM copies the contents of package.json before prepublish script is executed. This makes the internal prepublish logic impossible. prepublish and postpublish commands are exposed for testing only.

Internal prepublish logic.

  1. Backup the existing ./node_modules.
  2. Backup the existing ./package.json.
  3. Install package dependencies (npm install --production).
  4. Compress ./node_modules to ./bundled_modules.tar.
  5. Remove all dependencies from ./package.json.
  6. Add bundled-dependencies dependency to ./package.json.
  7. Add postinstall script to ./package.json.

Internal postpublish logic.

  1. Delete ./bundled_modules.tar.
  2. Delete ./package.json.
  3. Restore the original ./node_modules.
  4. Restore the original ./package.json.

postinstall script

The postinstall script is:

bundled-dependencies extract
  1. Deletes ./node_modules.
  2. Extracts ./bundled_modules.tar to ./node_modules.