New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

check-npm-yarn

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-npm-yarn

CLI to check NPM or Yarn if specified, or look for package-lock.json or yarn.lock

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

  • preinstall npm hook doesn’t execute when installing a specific package
    • So, I created another cli script, nsi. Try this,
npm install -g check-npm-yarn
nsi packageA packageB packageC ...

How

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

Keywords

FAQs

Package last updated on 16 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc