diff options
Diffstat (limited to 'node_modules/is-npm')
-rw-r--r-- | node_modules/is-npm/index.d.ts | 41 | ||||
-rw-r--r-- | node_modules/is-npm/index.js | 11 | ||||
-rw-r--r-- | node_modules/is-npm/license | 9 | ||||
-rw-r--r-- | node_modules/is-npm/package.json | 39 | ||||
-rw-r--r-- | node_modules/is-npm/readme.md | 60 |
5 files changed, 0 insertions, 160 deletions
diff --git a/node_modules/is-npm/index.d.ts b/node_modules/is-npm/index.d.ts deleted file mode 100644 index 5338775..0000000 --- a/node_modules/is-npm/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** -Check if your code is running as an [npm](https://docs.npmjs.com/misc/scripts) or [yarn](https://yarnpkg.com/lang/en/docs/cli/run/) script. - -@example -``` -import {isNpmOrYarn} from 'is-npm'; - -if (isNpmOrYarn) { - console.log('Running as an npm or yarn script!'); -} -``` -*/ -export const isNpmOrYarn: boolean; - -/** -Check if your code is running as an [npm](https://docs.npmjs.com/misc/scripts) script. - -@example -``` -import {isNpm} from 'is-npm'; - -if (isNpm) { - console.log('Running as an npm script!'); -} -``` -*/ -export const isNpm: boolean; - -/** -Check if your code is running as a [yarn](https://yarnpkg.com/lang/en/docs/cli/run/) script. - -@example -``` -import {isYarn} from 'is-npm'; - -if (isYarn) { - console.log('Running as a yarn script!'); -} -``` -*/ -export const isYarn: boolean; diff --git a/node_modules/is-npm/index.js b/node_modules/is-npm/index.js deleted file mode 100644 index 000a893..0000000 --- a/node_modules/is-npm/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const packageJson = process.env.npm_package_json; -const userAgent = process.env.npm_config_user_agent; -const isYarn = Boolean(userAgent && userAgent.startsWith('yarn')); -const isNpm = Boolean(userAgent && userAgent.startsWith('npm')); -const isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json')); - -module.exports.isNpmOrYarn = isNpm || isNpm7 || isYarn; -module.exports.isNpm = isNpm || isNpm7; -module.exports.isYarn = isYarn; diff --git a/node_modules/is-npm/license b/node_modules/is-npm/license deleted file mode 100644 index fa7ceba..0000000 --- a/node_modules/is-npm/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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/is-npm/package.json b/node_modules/is-npm/package.json deleted file mode 100644 index fad5d25..0000000 --- a/node_modules/is-npm/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "is-npm", - "version": "5.0.0", - "description": "Check if your code is running as an npm script", - "license": "MIT", - "repository": "sindresorhus/is-npm", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "npm", - "yarn", - "is", - "check", - "detect", - "env", - "environment", - "run", - "script" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.11.0", - "xo": "^0.30.0" - } -} diff --git a/node_modules/is-npm/readme.md b/node_modules/is-npm/readme.md deleted file mode 100644 index b18ba10..0000000 --- a/node_modules/is-npm/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# is-npm [![Build Status](https://travis-ci.com/sindresorhus/is-npm.svg?branch=master)](https://travis-ci.com/sindresorhus/is-npm) - -> Check if your code is running as an [npm](https://docs.npmjs.com/misc/scripts) or [yarn](https://yarnpkg.com/lang/en/docs/cli/run/) script - -## Install - -``` -$ npm install is-npm -``` - -## Usage - -```js -const {isNpmOrYarn, isNpm, isYarn} = require('is-npm'); - -console.table({isNpmOrYarn, isNpm, isYarn}); -``` - -```sh -$ node foo.js -# ┌─────────────┬────────┐ -# │ (index) │ Values │ -# ├─────────────┼────────┤ -# │ isNpmOrYarn │ false │ -# │ isNpm │ false │ -# │ isYarn │ false │ -# └─────────────┴────────┘ -$ npm run foo -# ┌─────────────┬────────┐ -# │ (index) │ Values │ -# ├─────────────┼────────┤ -# │ isNpmOrYarn │ true │ -# │ isNpm │ true │ -# │ isYarn │ false │ -# └─────────────┴────────┘ -$ yarn run foo -# ┌─────────────┬────────┐ -# │ (index) │ Values │ -# ├─────────────┼────────┤ -# │ isNpmOrYarn │ true │ -# │ isNpm │ false │ -# │ isYarn │ true │ -# └─────────────┴────────┘ -``` - -## Related - -- [is-npm-cli](https://github.com/sindresorhus/is-npm-cli) - CLI for this module - ---- - -<div align="center"> - <b> - <a href="https://tidelift.com/subscription/pkg/npm-is-npm?utm_source=npm-is-npm&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> - </b> - <br> - <sub> - Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. - </sub> -</div> |