1# is-npm [](https://travis-ci.org/sindresorhus/is-npm) 2 3> Check if your code is running as an [npm script](https://www.npmjs.org/doc/misc/npm-scripts.html) 4 5 6## Install 7 8```sh 9$ npm install --save is-npm 10``` 11 12 13## Usage 14 15```js 16var isNpm = require('is-npm'); 17console.log(isNpm); 18``` 19 20```sh 21$ node foo.js 22#=> false 23$ npm run foo 24#=> true 25``` 26 27 28## License 29 30MIT © [Sindre Sorhus](http://sindresorhus.com) 31