https://github.com/lmammino/package-strip-deps
A little command line utility that allows to strip dependencies from a NPM package.json file
https://github.com/lmammino/package-strip-deps
node nodejs package redirection strip-deps
Last synced: about 1 year ago
JSON representation
A little command line utility that allows to strip dependencies from a NPM package.json file
- Host: GitHub
- URL: https://github.com/lmammino/package-strip-deps
- Owner: lmammino
- License: mit
- Created: 2016-11-03T23:58:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-08T03:18:50.000Z (over 1 year ago)
- Last Synced: 2025-04-13T11:17:02.115Z (over 1 year ago)
- Topics: node, nodejs, package, redirection, strip-deps
- Language: JavaScript
- Homepage: https://lmammino.github.io/package-strip-deps/
- Size: 290 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# package-strip-deps
[](http://badge.fury.io/js/package-strip-deps)
[](https://travis-ci.org/lmammino/package-strip-deps)
[](https://codecov.io/gh/lmammino/package-strip-deps)
[](https://standardjs.com)
A little command line utility that allows to strip dependencies from a NPM package.json file.
The command basically takes the JSON content of a `package.json` file and prints in the standard output the same content but by stripping
the keys `dependencies` and `devDependencies`.
## Install
Globally:
```bash
npm install --global package-strip-deps
```
Or as a dev dependency (e.g. you need it as part of your build process)
```bash
npm install --save-dev package-strip-deps
```
## Usage
Using "pipes":
```bash
cat package.json | package-strip-deps
```
Using input redirection:
```bash
package-strip-deps < package.json
```
If you want to save the output to a file just use output redirection:
```bash
package-strip-deps < package.json > strippedPackage.json
```
## Keep specific packages
If you want to keep specific packages from either `dependencies` or `devDependencies`,
you can use the `--keep` flag as follows:
```bash
package-strip-deps --keep serverless --keep lodash
```
In this case `serverless` and `lodash` will remain in the final JSON and all the other
dependencies will be stripped
## Contributing
Everyone is very welcome to contribute to this project.
You can contribute just by submitting bugs or suggesting improvements by
[opening an issue on GitHub](https://github.com/lmammino/package-strip-deps/issues).
## License
Licensed under [MIT License](LICENSE). © Luciano Mammino.