has-yarn
Check if a project is using Yarn
Last updated 8 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install has-yarn 
SYNC missed versions from official npm registry.

has-yarn

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
import hasYarn from '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()

The current working directory.

Related

Current Tags

  • 3.0.0                                ...           latest (3 years ago)

4 Versions

  • 3.0.0                                ...           3 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2013 - present © cnpmjs.org | Home |