has-yarn ![Build Status](https://camo.githubusercontent.com/dc685c0985b5b9b0b65366f472a8ef2f9f84e30955aaac1418c3f0715faacf53/68747470733a2f2f7472617669732d63692e6f72672f73696e647265736f726875732f6861732d7961726e2e7376673f6272616e63683d6d6173746572)
Check if a project is using Yarn
Useful for tools that needs to know whether to use yarn
or npm
to install dependencies.
It checks if a yarn.lock
file is present in the working directory.
Install
$ npm install has-yarn
Usage
.
├── foo
│ └── package.json
└── bar
├── package.json
└── yarn.lock
const hasYarn = require('has-yarn');
hasYarn('foo');
//=> false
hasYarn('bar');
//=> true
API
hasYarn([cwd])
Returns a boolean
of whether the project uses Yarn.
cwd
Type: string
Default: process.cwd()
Current working directory.
Related
- has-yarn-cli - CLI for this module
License
MIT © Sindre Sorhus