Check if your code is running as an npm script
github.com/sindresorhus/is-npm
sindresorhus/is-npm
Latest: 6.0.0
4 years ago