All Projects → ModClean → Modclean

ModClean / Modclean

Licence: mit
Remove unwanted files and directories from your node_modules folder

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Modclean

Kondo
Save disk space by cleaning non-essential files from software projects.
Stars: ✭ 373 (+20.71%)
Mutual labels:  disk-space, cleaner, cli
Skrub
A package to remove junk from Composer installations and trim build sizes.
Stars: ✭ 91 (-70.55%)
Mutual labels:  disk-space, cleaner, cleanup
Tin Summer
Find build artifacts that are taking up disk space
Stars: ✭ 259 (-16.18%)
Mutual labels:  disk-space, clean, cleaner
vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (-91.59%)
Mutual labels:  node-module, nodejs-modules
Cleaner 42
Only for 42Network schools, Cleaner_42 script is linked to cclean command/program, and it saves you some memory space.
Stars: ✭ 186 (-39.81%)
Mutual labels:  clean, cleaner
RandomProxyRuby
Tiny Library for get random proxy (free).
Stars: ✭ 16 (-94.82%)
Mutual labels:  module, modules
Docker Registry Manifest Cleanup
Cleans up docker registry by removing untagged manifests from the registry
Stars: ✭ 127 (-58.9%)
Mutual labels:  disk-space, cleanup
nuxt-modules
AX2's Nuxt modules
Stars: ✭ 30 (-90.29%)
Mutual labels:  module, modules
node-screenlogic
Pentair ScreenLogic Javascript library using Node.JS
Stars: ✭ 38 (-87.7%)
Mutual labels:  node-module, nodejs-modules
node-advanced
Node Advanced Courseware
Stars: ✭ 80 (-74.11%)
Mutual labels:  module, node-module
js-cleanup
Smart comment and whitespace cleaner for JavaScript-like files
Stars: ✭ 22 (-92.88%)
Mutual labels:  clean, cleanup
laravel-admin
Laravel Admin panel with theme , modules ,artisan commands and helper classess.Laravel admin boilerplate with theme and modules
Stars: ✭ 22 (-92.88%)
Mutual labels:  module, modules
OregonCore-Modules
Modules made for Oregoncore
Stars: ✭ 18 (-94.17%)
Mutual labels:  module, modules
shopyo
shopyo.readthedocs.org
Stars: ✭ 66 (-78.64%)
Mutual labels:  module, modules
removedupes
Remove Duplicate Messages
Stars: ✭ 52 (-83.17%)
Mutual labels:  cleanup, cleaner
jetbrains-utility
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
Stars: ✭ 62 (-79.94%)
Mutual labels:  cleanup, cleaner
falcon
A WordPress cleanup and performance optimization plugin.
Stars: ✭ 17 (-94.5%)
Mutual labels:  cleanup, cleaner
LibPQ
Detach your M code from workbooks to reuse it! Import modules from local or web storage (unlimited number of sources)
Stars: ✭ 55 (-82.2%)
Mutual labels:  module, modules
Sweep
Reduce the disk usage of your projects by removing dependencies & builds
Stars: ✭ 105 (-66.02%)
Mutual labels:  disk-space, cleanup
laravel-module-loader
THIS PACKAGE HAS BEEN DEPRECATED — A lightweight package to organize your code into contextual modules.
Stars: ✭ 76 (-75.4%)
Mutual labels:  module, modules

ModClean

Remove unwanted files and directories from your node_modules folder

npm version NPM Dependencies NPM Downloads GitHub license GitHub issues Package Quality

This documentation is for ModClean 2.x which requires Node v6.9+, if you need to support older versions, use ModClean 1.3.0 instead.

ModClean is a utility that finds and removes unnecessary files and folders from your node_modules directory based on predefined and custom glob patterns. This utility comes with both a CLI and a programmatic API to provide customization for your environment. ModClean is used and tested in an Enterprise environment on a daily basis.

Why?

There are a few different reasons why you would want to use ModClean:

  • Commiting Modules. Some environments (especially Enterprise), it's required to commit the node_modules directory with your application into version control. This is due to compatibility, vetting and vunerability scanning rules for open source software. This can lead to issues with project size, checking out/pulling changes and the infamous 255 character path limit if you're unlucky enough to be on Windows or SVN.
  • Wasted space on your server. Why waste space on your server with files not needed by you or the modules?
  • Packaged applications. If you're required to package your application, you can reduce the size of the package quickly by removing unneeded files.
  • Compiled applications. Other tools like, NW.js and Electron make it easy to create cross-platform desktop apps, but depending on the modules, your app can become huge. Reduce down the size of the compiled application before shipping and make it faster for users to download.
  • Save space on your machine. Depending on the amount of global modules you have installed, you can reduce their space by removing those gremlin files.
  • and much more!

The 🍰 is a lie, but the Benchmarks are not.

How?

New! In ModClean 2.0.0, patterns are now provided by plugins instead of a static patterns.json file as part of the module. By default, ModClean comes with modclean-patterns-default installed, providing the same patterns as before. You now have the ability to create your own patterns plugins and use multiple plugins to clean your modules. This allows flexibility with both the programmatic API and CLI.

ModClean scans the node_modules directory of your choosing, finding all files and folders that match the defined patterns and deleting them. Both the CLI and the programmatic API provides all the options needed to customize this process to your requirements. Depending on the number of modules your app requires, files can be reduced anywhere from hundreds to thousands and disk space can be reduced considerably.

(File and disk space reduction can also be different between the version of NPM and Operating System)

IMPORTANT This module has been heavily tested in an enterprise environment used for large enterprise applications. The provided patterns in modclean-patterns-default have worked very well when cleaning up useless files in many popular modules. There are hundreds of thousands of modules in NPM and I cannot simply cover them all. If you are using ModClean for the first time on your application, you should create a copy of the application so you can ensure it still runs properly after running ModClean. The patterns are set in a way to ensure no crutial module files are removed, although there could be one-off cases where a module could be affected and that's why I am stressing that testing and backups are important. If you find any files that should be removed, please create a pull request to modclean-patterns-default or create your own patterns plugin to share with the community.

Removal Benchmark

So how well does this module work? If we npm install sails and run ModClean on it, here are the results:

All tests ran on macOS 10.12.3 with Node v6.9.1 and NPM v4.0.5

Using Default Safe Patterns

modclean -n default:safe or modclean

Total Files Total Folders Total Size
Before ModClean 16,179 1,941 71.24 MB
After ModClean 12,192 1,503 59.35 MB
Reduced 3,987 438 11.88 MB

Using Safe and Caution Patterns

modclean -n default:safe,default:caution

Total Files Total Folders Total Size
Before ModClean 16,179 1,941 71.24 MB
After ModClean 11,941 1,473 55.28 MB
Reduced 4,238 468 15.95 MB

Using Safe, Caution and Danger Patterns

modclean --patterns="default:*"

Total Files Total Folders Total Size
Before ModClean 16,179 1,941 71.24 MB
After ModClean 11,684 1,444 51.76 MB
Reduced 4,495 497 19.47 MB

That makes a huge difference in the amount of files and disk space.

View additional benchmarks on the Wiki: Benchmarks. If you would like to run some of your own benchmarks, you can use modclean-benchmark.

Install

Install locally

npm install modclean --save

Install globally (CLI)

npm install modclean -g

Read the CLI Documentation

Read the API Documentation

Read the Custom Patterns Plugin Documentation


Issues

If you find any bugs with either ModClean or the CLI Utility, please feel free to open an issue. Any feature requests may also be poseted in the issues.

License

ModClean is licensed under the MIT license. Please see LICENSE in the repository for the full text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].