budibase/packages/backend-core/node_modules/is-npm
Budibase Helm Bot c1e5378350 Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00
..
index.d.ts Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00
index.js Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00
license Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00
package.json Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00
readme.md Helm Release: 1.2.36 2022-08-11 08:17:28 +00:00

readme.md

is-npm Build Status

Check if your code is running as an npm or yarn script

Install

$ npm install is-npm

Usage

const {isNpmOrYarn, isNpm, isYarn} = require('is-npm');

console.table({isNpmOrYarn, isNpm, isYarn});
$ node foo.js
# ┌─────────────┬────────┐
# │   (index)   │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │ false  │
# │    isNpm    │ false  │
# │   isYarn    │ false  │
# └─────────────┴────────┘
$ npm run foo
# ┌─────────────┬────────┐
# │   (index)   │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │  true  │
# │    isNpm    │  true  │
# │   isYarn    │ false  │
# └─────────────┴────────┘
$ yarn run foo
# ┌─────────────┬────────┐
# │   (index)   │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │  true  │
# │    isNpm    │ false  │
# │   isYarn    │  true  │
# └─────────────┴────────┘

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.