nm_cleaner
Cleans node_modules from non code files.
Last updated a year ago by dropthebeatbro .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nm_cleaner 
SYNC missed versions from official npm registry.

NM_Cleaner :recycle:

Cleans node_modules from non code files (e.g. README.md).

[WARNING] This utility is unstable and not production-ready.

Cleaning Results

Package Name node_modules before node_modules after
create-react-app@2.1.5 101 Mb 85.74 Mb
koa@2.7 737.30 Kb 420.88 Kb
express@4.6.14 1548.30 Kb 971.91 Kb

Installation

Tested on versions: yarn: 1.13 node: 11.10

npm i -g nm_cleaner

# or
yarn global add nm_cleaner

Usage

Just clean the node_modules in a project directory.

nm_clean <project_folder>

Show files that are deleted.

nm_clean <project_folder> -a

Demo

mkdir nm_clean-demo
cd nm_clean-demo
npm init -y
npm i koa
nm_clean ./ -a

Demo uses koa, express and fs-extra packages for demonstration.

How it works

nm_clean goes recursively through node_modules, then picks unnessesary files and deletes them. Yes, so simple.

Supported extensions & directories

  • Markdown files
  • License files
  • Every file ending with 'rc'
  • 'ignore' files
  • Makefile
  • Tests and example directories
  • YAML files, for example travis.yml
  • Unnesesary config files such as .editorconfig

and some more in the future...

TODO

  • [x] Create nm_clean
  • [x] Also remove directories
  • [ ] Add timers to count how many seconds it took to clean
  • [ ] Make everything async for better perfomance
  • [x] Publish the package
  • [ ] Create plugin for Gulp & Webpack
  • [ ] Add more file extensions

Current Tags

  • 1.0.4                                ...           latest (a year ago)

5 Versions

  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |