diff options
| author | ruki <waruqi@gmail.com> | 2018-11-08 00:38:48 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-11-07 21:53:09 +0800 |
| commit | 26105034da4fcce7ac883c899d781f016559310d (patch) | |
| tree | c459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/is-npm | |
| parent | 2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff) | |
| download | xmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip | |
switch to vuepress
Diffstat (limited to 'node_modules/is-npm')
| -rw-r--r-- | node_modules/is-npm/index.js | 4 | ||||
| -rw-r--r-- | node_modules/is-npm/package.json | 32 | ||||
| -rw-r--r-- | node_modules/is-npm/readme.md | 30 |
3 files changed, 66 insertions, 0 deletions
diff --git a/node_modules/is-npm/index.js b/node_modules/is-npm/index.js new file mode 100644 index 00000000..b5f3c27a --- /dev/null +++ b/node_modules/is-npm/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = 'npm_config_username' in process.env || + 'npm_package_name' in process.env || + 'npm_config_heading' in process.env; diff --git a/node_modules/is-npm/package.json b/node_modules/is-npm/package.json new file mode 100644 index 00000000..5c6f3800 --- /dev/null +++ b/node_modules/is-npm/package.json @@ -0,0 +1,32 @@ +{ + "name": "is-npm", + "version": "1.0.0", + "description": "Check if your code is running as an npm script", + "license": "MIT", + "repository": "sindresorhus/is-npm", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "npm", + "is", + "check", + "detect", + "env", + "environment" + ], + "devDependencies": { + "ava": "0.0.3" + } +} diff --git a/node_modules/is-npm/readme.md b/node_modules/is-npm/readme.md new file mode 100644 index 00000000..84833ec6 --- /dev/null +++ b/node_modules/is-npm/readme.md @@ -0,0 +1,30 @@ +# is-npm [](https://travis-ci.org/sindresorhus/is-npm) + +> Check if your code is running as an [npm script](https://www.npmjs.org/doc/misc/npm-scripts.html) + + +## Install + +```sh +$ npm install --save is-npm +``` + + +## Usage + +```js +var isNpm = require('is-npm'); +console.log(isNpm); +``` + +```sh +$ node foo.js +#=> false +$ npm run foo +#=> true +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |
