From 383285ecd5292bf9a825e05904955b937de84cc9 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Jun 2022 08:51:01 +0200 Subject: Initial commit --- node_modules/is-npm/index.d.ts | 41 +++++++++++++++++++++++++++ node_modules/is-npm/index.js | 11 ++++++++ node_modules/is-npm/license | 9 ++++++ node_modules/is-npm/package.json | 39 ++++++++++++++++++++++++++ node_modules/is-npm/readme.md | 60 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 160 insertions(+) create mode 100644 node_modules/is-npm/index.d.ts create mode 100644 node_modules/is-npm/index.js create mode 100644 node_modules/is-npm/license create mode 100644 node_modules/is-npm/package.json create mode 100644 node_modules/is-npm/readme.md (limited to 'node_modules/is-npm') diff --git a/node_modules/is-npm/index.d.ts b/node_modules/is-npm/index.d.ts new file mode 100644 index 0000000..5338775 --- /dev/null +++ b/node_modules/is-npm/index.d.ts @@ -0,0 +1,41 @@ +/** +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 new file mode 100644 index 0000000..000a893 --- /dev/null +++ b/node_modules/is-npm/index.js @@ -0,0 +1,11 @@ +'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 new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/is-npm/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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 new file mode 100644 index 0000000..fad5d25 --- /dev/null +++ b/node_modules/is-npm/package.json @@ -0,0 +1,39 @@ +{ + "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 new file mode 100644 index 0000000..b18ba10 --- /dev/null +++ b/node_modules/is-npm/readme.md @@ -0,0 +1,60 @@ +# 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 + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
-- cgit