Import Upstream version 1.0.0
suman
6 years ago
0 | # editorconfig.org | |
1 | root = true | |
2 | ||
3 | [*] | |
4 | indent_style = tab | |
5 | end_of_line = lf | |
6 | charset = utf-8 | |
7 | trim_trailing_whitespace = true | |
8 | insert_final_newline = true | |
9 | ||
10 | [package.json] | |
11 | indent_style = space | |
12 | indent_size = 2 | |
13 | ||
14 | [*.md] | |
15 | trim_trailing_whitespace = false |
0 | * text=auto |
0 | node_modules |
0 | { | |
1 | "node": true, | |
2 | "esnext": true, | |
3 | "bitwise": true, | |
4 | "camelcase": true, | |
5 | "curly": true, | |
6 | "immed": true, | |
7 | "newcap": true, | |
8 | "noarg": true, | |
9 | "undef": true, | |
10 | "unused": "vars", | |
11 | "strict": true | |
12 | } |
0 | 'use strict'; | |
1 | module.exports = 'npm_config_username' in process.env || | |
2 | 'npm_package_name' in process.env || | |
3 | 'npm_config_heading' in process.env; |
0 | The MIT License (MIT) | |
1 | ||
2 | Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) | |
3 | ||
4 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
5 | of this software and associated documentation files (the "Software"), to deal | |
6 | in the Software without restriction, including without limitation the rights | |
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
8 | copies of the Software, and to permit persons to whom the Software is | |
9 | furnished to do so, subject to the following conditions: | |
10 | ||
11 | The above copyright notice and this permission notice shall be included in | |
12 | all copies or substantial portions of the Software. | |
13 | ||
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
20 | THE SOFTWARE. |
0 | { | |
1 | "name": "is-npm", | |
2 | "version": "1.0.0", | |
3 | "description": "Check if your code is running as an npm script", | |
4 | "license": "MIT", | |
5 | "repository": "sindresorhus/is-npm", | |
6 | "author": { | |
7 | "name": "Sindre Sorhus", | |
8 | "email": "sindresorhus@gmail.com", | |
9 | "url": "http://sindresorhus.com" | |
10 | }, | |
11 | "engines": { | |
12 | "node": ">=0.10.0" | |
13 | }, | |
14 | "scripts": { | |
15 | "test": "node test.js" | |
16 | }, | |
17 | "files": [ | |
18 | "index.js" | |
19 | ], | |
20 | "keywords": [ | |
21 | "npm", | |
22 | "is", | |
23 | "check", | |
24 | "detect", | |
25 | "env", | |
26 | "environment" | |
27 | ], | |
28 | "devDependencies": { | |
29 | "ava": "0.0.3" | |
30 | } | |
31 | } |
0 | # is-npm [![Build Status](https://travis-ci.org/sindresorhus/is-npm.svg?branch=master)](https://travis-ci.org/sindresorhus/is-npm) | |
1 | ||
2 | > Check if your code is running as an [npm script](https://www.npmjs.org/doc/misc/npm-scripts.html) | |
3 | ||
4 | ||
5 | ## Install | |
6 | ||
7 | ```sh | |
8 | $ npm install --save is-npm | |
9 | ``` | |
10 | ||
11 | ||
12 | ## Usage | |
13 | ||
14 | ```js | |
15 | var isNpm = require('is-npm'); | |
16 | console.log(isNpm); | |
17 | ``` | |
18 | ||
19 | ```sh | |
20 | $ node foo.js | |
21 | #=> false | |
22 | $ npm run foo | |
23 | #=> true | |
24 | ``` | |
25 | ||
26 | ||
27 | ## License | |
28 | ||
29 | MIT © [Sindre Sorhus](http://sindresorhus.com) |