Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luftywiranda13/del-nm
Delete `node_modules` and lockfiles
https://github.com/luftywiranda13/del-nm
cleanup delete dependencies lockfile npm yarn
Last synced: about 5 hours ago
JSON representation
Delete `node_modules` and lockfiles
- Host: GitHub
- URL: https://github.com/luftywiranda13/del-nm
- Owner: luftywiranda13
- License: mit
- Created: 2017-09-13T15:11:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T09:18:26.000Z (over 4 years ago)
- Last Synced: 2024-12-25T15:48:10.515Z (about 1 month ago)
- Topics: cleanup, delete, dependencies, lockfile, npm, yarn
- Language: JavaScript
- Homepage:
- Size: 106 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# del-nm
> Delete `node_modules` and lockfiles
[![Package Version](https://img.shields.io/npm/v/del-nm.svg?style=flat-square)](https://www.npmjs.com/package/del-nm)
[![Downloads Status](https://img.shields.io/npm/dm/del-nm.svg?style=flat-square)](https://npm-stat.com/charts.html?package=del-nm&from=2016-04-01)
[![Build Status: Linux](https://img.shields.io/travis/luftywiranda13/del-nm/master.svg?style=flat-square)](https://travis-ci.org/luftywiranda13/del-nm)
[![Coverage Status](https://img.shields.io/codecov/c/github/luftywiranda13/del-nm/master.svg?style=flat-square)](https://codecov.io/gh/luftywiranda13/del-nm)Useful to perform fresh installation of dependencies.
## Installation
```sh
npm install --save del-nm
```## Usage
```sh
$ tree
.
├── bar
│ ├── node_modules
│ └── yarn.lock
└── foo
├── node_modules
└── package-lock.json
``````js
const delNm = require('del-nm');delNm({ cwd: 'bar' }).then(paths => {
console.log(paths);
/*
[
'/Users/luftywiranda/bar/node_modules',
'/Users/luftywiranda/bar/yarn.lock'
]
*/
});delNm({ cwd: 'foo' }).then(paths => {
console.log(paths);
/*
[
'/Users/luftywiranda/foo/node_modules',
'/Users/luftywiranda/foo/package-lock.json'
]
*/
});delNm().then(paths => {
console.log(paths);
//=> []
});
```## API
### delNm([options])
Returns `Promise` of deleted paths.
#### options
Type: `Object`
##### cwd
Type: `string`
Default: `process.cwd()`Current working directory.
##### lockfiles
Type: `boolean`
Default: `true`Set this to `false` to not delete lockfiles. Remember that `npm-shrinkwrap.json` will also be deleted when this option is set to `true`.
## Related
* [del-nm-cli](https://github.com/luftywiranda13/del-nm-cli) - CLI for this module
* [force-del](https://github.com/luftywiranda13/force-del) - Force delete files or folders using glob patterns
* [remove-lockfiles](https://github.com/luftywiranda13/remove-lockfiles) - Prevent committing lockfiles## License
MIT © [Lufty Wiranda](https://www.luftywiranda.com)