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

cost-of-modules

v1.0.1

Published

Find out which of your dependencies are slowing you down 🐢

Downloads

3,819

Readme

Cost of modules

Find out which of your dependencies is slowing you down

Build
Status npm npm

Find out which of your dependencies is causing bloat

Install

npm install -g cost-of-modules

Usage

Run cost-of-modules in the directory you are working in.

Options

--less Show the biggest 10 modules

--yarn Use yarn instead of npm to install dependencies

--no-install Skip installation

--include-dev Include devDependencies as well - for 🚀 collaborator experience

Show your support

:star: this repo

Motivation

I recently published a npm module (auto-install) and I wanted to know how many bytes am I making people download before they can use it. Turns out, it was a whopping 30M!

More than space on disk, I want to optimise for install speed - setup is part of the user experience

--

Now, there are 3 things that you can do to make your npm package smaller

  1. Make sure all your workflow tools are in devDependencies and not in dependencies These include your build tools, testing frameworks, etc. Only dependencies get installed when someone installs your package. (That being said, for better collaborator experience, you should optimise for both)

  2. Only include the files you need by using files in your package.json or by including a .npmignore. More on that here.

  3. Use packages which do the job and take the least amount of space. For example, I realised that I did not need yargs, I only needed their parser yargs-parser which is much smaller.

  4. Bonus: Bundle all your code together and strip out the functions that you don't use - I still have to try this out. This could be the most impactful one.

--

In my case, the big size was because of # 3, the bunch of npm packages that I was using.

You can't fix what you can't measure

With npm 2.x, it was easy to find how much space is each of your dependencies taking. You could just look at the size of each directory in node_modules

With npm 3, the packages are installed in flat manner, so it isn't so straightforward.

That's the reason why I created this tool.

--

Future

I would want to make this tool a pre-publish checklist.

  • [x] See the size of your node_modules
  • [ ] Include the size of your files
  • [ ] Check if files or .npmignore exists
  • [ ] Check if there are any dev dependencies that are specified as dependencies (tricky)
  • [ ] Compare size with the last release. Something like this: Warning

License

MIT © siddharthkp