diff options
Diffstat (limited to 'node_modules/has-yarn')
-rw-r--r-- | node_modules/has-yarn/index.js | 5 | ||||
-rw-r--r-- | node_modules/has-yarn/license | 21 | ||||
-rw-r--r-- | node_modules/has-yarn/package.json | 40 | ||||
-rw-r--r-- | node_modules/has-yarn/readme.md | 53 |
4 files changed, 119 insertions, 0 deletions
diff --git a/node_modules/has-yarn/index.js b/node_modules/has-yarn/index.js new file mode 100644 index 000000000..f7ff13dbd --- /dev/null +++ b/node_modules/has-yarn/index.js @@ -0,0 +1,5 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); + +module.exports = cwd => fs.existsSync(path.resolve(cwd || process.cwd(), 'yarn.lock')); diff --git a/node_modules/has-yarn/license b/node_modules/has-yarn/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/has-yarn/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-yarn/package.json b/node_modules/has-yarn/package.json new file mode 100644 index 000000000..6aecd9da9 --- /dev/null +++ b/node_modules/has-yarn/package.json @@ -0,0 +1,40 @@ +{ + "name": "has-yarn", + "version": "1.0.0", + "description": "Check if a project is using Yarn", + "license": "MIT", + "repository": "sindresorhus/has-yarn", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "yarn", + "has", + "detect", + "is", + "project", + "app", + "module", + "package", + "manager", + "npm" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "xo": { + "esnext": true + } +} diff --git a/node_modules/has-yarn/readme.md b/node_modules/has-yarn/readme.md new file mode 100644 index 000000000..5ca107d90 --- /dev/null +++ b/node_modules/has-yarn/readme.md @@ -0,0 +1,53 @@ +# has-yarn [](https://travis-ci.org/sindresorhus/has-yarn) + +> Check if a project is using [Yarn](https://yarnpkg.com) + +Useful for tools that needs to know whether to use `yarn` or `npm` to install dependencies. + + +## Install + +``` +$ npm install --save has-yarn +``` + + +## Usage + +``` +. +├── foo +│ └── package.json +└── bar + ├── package.json + └── yarn.lock +``` + +```js +const hasYarn = require('has-yarn'); + +hasYarn('foo'); +//=> false + +hasYarn('bar'); +//=> true +``` + + +## API + +### hasYarn([cwd]) + +Returns a `boolean`. + +#### cwd + +Type: `string`<br> +Default: `process.cwd()` + +Current working directory. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) |