aboutsummaryrefslogtreecommitdiff
path: root/node_modules/has-yarn
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/has-yarn')
-rw-r--r--node_modules/has-yarn/index.d.ts16
-rw-r--r--node_modules/has-yarn/index.js9
-rw-r--r--node_modules/has-yarn/license9
-rw-r--r--node_modules/has-yarn/package.json39
-rw-r--r--node_modules/has-yarn/readme.md60
5 files changed, 133 insertions, 0 deletions
diff --git a/node_modules/has-yarn/index.d.ts b/node_modules/has-yarn/index.d.ts
new file mode 100644
index 0000000..5e2af4c
--- /dev/null
+++ b/node_modules/has-yarn/index.d.ts
@@ -0,0 +1,16 @@
+declare const hasYarn: {
+ /**
+ * Check if a project is using [Yarn](https://yarnpkg.com).
+ *
+ * @param cwd - Current working directory. Default: `process.cwd()`.
+ * @returns Whether the project uses Yarn.
+ */
+ (cwd?: string): boolean;
+
+ // TODO: Remove this for the next major release, refactor the whole definition to:
+ // declare function hasYarn(cwd?: string): boolean;
+ // export = hasYarn;
+ default: typeof hasYarn;
+};
+
+export = hasYarn;
diff --git a/node_modules/has-yarn/index.js b/node_modules/has-yarn/index.js
new file mode 100644
index 0000000..a1f4eed
--- /dev/null
+++ b/node_modules/has-yarn/index.js
@@ -0,0 +1,9 @@
+'use strict';
+const path = require('path');
+const fs = require('fs');
+
+const hasYarn = (cwd = process.cwd()) => fs.existsSync(path.resolve(cwd, 'yarn.lock'));
+
+module.exports = hasYarn;
+// TODO: Remove this for the next major release
+module.exports.default = hasYarn;
diff --git a/node_modules/has-yarn/license b/node_modules/has-yarn/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/has-yarn/license
@@ -0,0 +1,9 @@
+MIT License
+
+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 0000000..be7aaa5
--- /dev/null
+++ b/node_modules/has-yarn/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "has-yarn",
+ "version": "2.1.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": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "yarn",
+ "has",
+ "detect",
+ "is",
+ "project",
+ "app",
+ "module",
+ "package",
+ "manager",
+ "npm"
+ ],
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.1",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/node_modules/has-yarn/readme.md b/node_modules/has-yarn/readme.md
new file mode 100644
index 0000000..0315c20
--- /dev/null
+++ b/node_modules/has-yarn/readme.md
@@ -0,0 +1,60 @@
+# has-yarn [![Build Status](https://travis-ci.org/sindresorhus/has-yarn.svg?branch=master)](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.
+
+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
+```
+
+```js
+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`<br>
+Default: `process.cwd()`
+
+Current working directory.
+
+
+## Related
+
+- [has-yarn-cli](https://github.com/sindresorhus/has-yarn-cli) - CLI for this module
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)