Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ban-yarn

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ban-yarn

Request that users use npm instead of yarn.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ban-yarn

NPM version Downloads

Request that users use npm instead of yarn.

If run from yarn instead of npm, the process will exit with error code 1 and print an error message.

Install

npm install --save-dev ban-yarn

Use

CLI

For example, in your package.json:

{
  "scripts": {
     "preinstall": "ban-yarn"
  }
}

Or if you have npx:

{
  "scripts": {
     "preinstall": "npx ban-yarn"
  }
}

You may provide a custom message via the -m flag:

{
  "scripts": {
     "preinstall": "npx ban-yarn -m 'Please use npm!'"
  }
}

Or, you may also provide a custom message read from a file via the -f flag:

{
  "scripts": {
     "preinstall": "npx ban-yarn -f path/to/customMessage.txt"
  }
}

You may disable ban-yarn by setting the DISABLE_USE_NPM environment variable to true:

{
  "scripts": {
     "preinstall": "DISABLE_USE_NPM=true npx ban-yarn"
  }
}

API

var useNpm = require('ban-yarn')

useNpm()

// or a custom message
useNpm('You should switch back to npm. Version >=5 is really great.');

Acknowledgements

Forked from use-yarn.


MIT © Shannon Moeller

FAQs

Package last updated on 06 Jul 2018

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