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

dmn

v2.2.2

Published

Node package dependency cleaner and .npmignore file generator.

Downloads

118

Readme

dmn

Build Status

Because I don't need your tests in my production!

Packages in npm are bloated with stuff which you will never ever use, like build files and different kinds of test data. Guys from npm provided us with .npmignore files, but seems like almost no one uses it. Please, stop publishing your development stuff to npm. If I would like to run your tests and start hacking on your project I will do git clone not npm install. Once our project has increased in size in 13Mb and this is just because of single test data file which was used by one of our dependencies (true story). Poor testing farm...

So:

  • If you spread installed packages across multiple machines in your environment then bloated dependencies make you unhappy.
  • If you get your local repo synced (e.g using Dropbox or Google Drive) then bloated dependencies make you unhappy (it takes so goddamn long to sync a big amount of smal useless files).
  • If you distribute your project to end-user not via npm then bloated dependencies make you unhappy.
  • If you are a good person who cares about others then bloated dependencies make you unhappy. Just imagine how much useless stuff which will never be used by anyone is fetched, served and stored by npm and e.g. TravisCI. Imagine how thousands of small useless files impacts installation time of your package.

dmn ("dependency minifier" or "damn missing .npmignore" or "dmn is a meaningless name") - is a command line tool which will help you deal with bloated dependencies. It can clean your node_modules from stuff which you will never need. And it can gracefully generate .npmignore file for your project. Both operations are based on list of ignore targets. Send me a pull request If I missed something in this list.

Install

$ npm install -g dmn

Usage

  Usage: dmn <command(s)> [options]

  Commands:
      gen         :  generate (or add items to existing) .npmignore file
                     To keep item in release package just prepend it's
                     pattern with '!'.
      clean       :  clean project's node_modules from useless clutter

  Options:
      -f, -force  :  don't ask for command confirmation
      -l, -list   :  list files that will be deleted by "clean" command

Examples

Generate .npmignore for your project:

$ cd <to_your_project>
$ dmn gen --f

Or do this before publishing:

$ dmn gen --f && npm publish

Or even better:

$ dmn gen --f && git add .npmignore && git commit ...

Clean your project's dependencies:

$ cd <to_your_project>
$ dmn clean --f

Clean newly installed dependency:

$ npm install --save <new_dependency> && dmn clean --f

Install dependencies then clean them for cloned repo:

$ git clone https://github.com/<username>/<reponame>
$ cd <reponame> && npm install && dmn clean --f

Questions or suggestions?

If you have any questions, please feel free to create an issue here on github.

Author

Ivan Nikulin ([email protected])