https://github.com/talentlessguy/node_modules_cleaner
🧹 Cleans node_modules from non code files.
https://github.com/talentlessguy/node_modules_cleaner
Last synced: about 1 year ago
JSON representation
🧹 Cleans node_modules from non code files.
- Host: GitHub
- URL: https://github.com/talentlessguy/node_modules_cleaner
- Owner: talentlessguy
- Created: 2019-02-21T07:50:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-24T21:10:46.000Z (almost 7 years ago)
- Last Synced: 2025-02-12T10:55:19.743Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 211 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NM_Cleaner 🧹
Cleans node_modules from non code files (e.g. README.md).
A very useful tool when transfering the project to offline environment.
## 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
### Requirements
* node >= 11.1
* yarn >= 1.13
```sh
npm i -g nm_cleaner
# or
yarn global add nm_cleaner
```
## Usage
Just clean the node_modules in a project directory.
```sh
nm_clean
```
Show files that are deleted.
```sh
nm_clean -a
```
## Demo
```sh
mkdir nm_clean-demo
cd nm_clean-demo
npm init -y
npm i koa
nm_clean ./ -a
```
## 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
- [x] Publish the package
- [ ] Add timers to count how many seconds it took to clean
- [ ] Make everything async for better perfomance
- [ ] Create plugin for Gulp & Webpack
- [ ] Add more file extensions