Nondeterministic Palindrome Machine
Miss any of our Open RFC calls?Watch the recordings here! »

del-nm

4.0.1 • Public • Published

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

Install

npm i del-nm

DownloadsWeekly Downloads

79

Version

4.0.1

License

MIT

Unpacked Size

5 kB

Total Files

4

Last publish

Collaborators

  • avatar