check-npm-yarn

1.2.1 • Public • Published

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.

{
  "scripts": {
    "preinstall": "if command -v check-npm-yarn > /dev/null; then check-npm-yarn; fi"
  }
}

Or

{
  "scripts": {
    "preinstall": "npx check-npm-yarn"
  }
}

Caveat

npm install -g check-npm-yarn
nsi packageA packageB packageC ...

How

This uses https://github.com/sindresorhus/is-npm

Readme

Keywords

Package Sidebar

Install

npm i check-npm-yarn

Weekly Downloads

3

Version

1.2.1

License

ISC

Unpacked Size

13.8 kB

Total Files

9

Last publish

Collaborators

  • patarapolw