1.0.4 • Published 6 years ago

ban-yarn v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

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

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago