4.0.1 • Published 6 years ago

del-nm v4.0.1

Weekly downloads
156
License
MIT
Repository
github
Last release
6 years ago

del-nm

Delete node_modules and lockfiles

Package Version Downloads Status Build Status: Linux Coverage Status

Useful to perform fresh installation of dependencies.

Installation

npm install --save del-nm

Usage

$ tree
.
├── bar
│   ├── node_modules
│   └── yarn.lock
└── foo
    ├── node_modules
    └── package-lock.json
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<Array> 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

License

MIT © Lufty Wiranda

4.0.1

6 years ago

4.0.0

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago