check-npm-yarn
CLI to check NPM or Yarn if specified, or look for package-lock.json or yarn.lock
Usage $ check-npm-yarn <type> ✔ You are using <type> Options --quiet Silence output (useful for scripts) Exits with code 0 if the project uses <type>, otherwise code 2
This is supposed to be used as a pre-install script, as follows in package.json
.
Or
Caveat
- preinstall npm hook doesn’t execute when installing a specific package
- So, I created another cli script,
nsi
. Try this,
- So, I created another cli script,
npm install -g check-npm-yarnnsi packageA packageB packageC ...
How
This uses https://github.com/sindresorhus/is-npm