Zero-dependency package to prune node_modules for unnecessary files as a post-build step
If the library has has helped you, please consider giving it a ⭐️
ryd is a zero dependency npm package that can be used to prune unnecessary files from ./node_modules
, such as markdown files, typescript source files and so on. The intention for this is to be used as either a post-build step in your pipeline or within a docker layer to decrease the size of your final image.
The node_modules
folder is know for being notoriously large, and anything that can be used to decrease the size is welcomed.
The irony that this is an npm package is not lost on my, however this package was developed to handle a very specific use case that was to prune the node_modules
after a multistage build in a node docker image.
ryd can be installed globally on a system using either yarn
or npm
:
$ yarn global add ryd
$ npm i -g ryd
or as a normal package in a node project:
$ yarn add ryd
$ npm i ryd
When you call ryd, it assumes that there is a node_modules
folder in the current working directory. If you are calling ryd from somewhere else, you can specify the absolute path to the node_modules
as an argument:
$ ryd [absolute_path_to_node_modules]
If you would like a exhaustive list of files/folders that ryd will remove, they can be found in the consts file.
If any issues occur using this library, please fill our a detailed bug report on GitHub.