百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dmn

> 编程语言
开源

为您的 node_modules 创建清洁工

99 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

为您的 node_modules 创建清洁工

dmn

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  [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 
$ 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 
$ dmn clean --f

Clean newly installed dependency:

$ npm install --save  && dmn clean --f

Install dependencies then clean them for cloned repo:

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

Supported Node.js versions

dmn supports Node.js versions 22.x and above.

Questions or suggestions?

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

Author

Ivan Nikulin ([email protected])

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言