Check if your code is running as an npm script
github.com/sindresorhus/is-npm-cli
sindresorhus/is-npm-cli