Check if the specific npm package has already been installed or not. If it has been installed, do nothing; Otherwise, install it.
$ npm install --save npm-check-install
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);
});
MIT © Canner