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 🙏

© 2024 – Pkg Stats / Ryan Hefner

shrinkhack

v1.0.0

Published

Works around prune bugs in npm 3.10.x to allow you to shrinkwrap your dependency tree

Downloads

2

Readme

Shrinkhack

The usefulness of this module will (hopefully) be short lived. This works around some bugs in npm to allow you to shrinkwrap without extra manual work.

What?

This module will clean up all extraneous packages in node_modules.

Why?

I <3 Shrinkpack. It's a fantastic tool that has sped up installs for my projects, both locally and in CI.

Unfortunately, there are some problems currently that prevent every project from being able to use it, including some of mine.

Problems

  1. Shrinkwrap requires a minimum npm version of 3.10.4

  2. npm versions < 3.10.6 && => 3.10.4 have a bug that will install all devDependencies associated with any module you rely on. This means a lot of extraneous dependencies end up in node_modules.

  3. Number 2 was fixed in npm 3.10.6. BUT, 3.10.6 introduced a bug that causes dependency trees with cycles to fail during shrinkwrap.

  4. npm prune would solve the problem this module addresses, but it has not been updated for the flat dependency tree in npm 3, so it fails to prune all modules that it should.

How?

This module does the following:

  1. Run npm list (which does identify the correct list of extraneous packages, unlike npm prune)
  2. Removes all those packages from node_modules
  3. Runs again, which is necessary due to npm's flat dependency tree. Once a package is removed in a prior run, more dependencies are then identified by npm list as extraneous.