An open API service indexing awesome lists of open source software.

https://github.com/cannercms/npm-check-install

Check whether a npm module is installed, otherwise installed it.
https://github.com/cannercms/npm-check-install

Last synced: 12 months ago
JSON representation

Check whether a npm module is installed, otherwise installed it.

Awesome Lists containing this project

README

          

# npm-check-install

Check if the specific npm package has already been installed or not. If it has been installed, do nothing; Otherwise, install it.

## Installation

```sh
$ npm install --save npm-check-install
```

## Usage

```js
const npmCheckInstall = require('npm-check-install');

npmCheckInstall('antd', { cwd: 'path to check and install' // default process.cwd() })
.then((hasFound) => {
// do stuff
})
.catch((err) => {
console.error('ERROR: ', err);
});
```

## License

MIT © [Canner](http://github.com/canner)