6.0.0 • Published 3 years ago

is-npm v6.0.0

Weekly downloads
8,217,903
License
MIT
Repository
github
Last release
3 years ago

is-npm

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

Install

npm install is-npm

Usage

import {isNpmOrYarn, isNpm, isYarn} from '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  │
# └─────────────┴────────┘

Related


update-notifierarchetype-libraryeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-image@cashremit/cr-streamline-iconsgkd-cliairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@kuss/gkd@ntt_app/react-native-custom-notificationdiscord-music-botsreact-native-covid-sdk@saeon/quick-formmysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsdyx-react@oiti/documentoscopy-react-nativequoc-testunblock-block-save-variables@infinitebrahmanuniverse/nolb-is-nluminos-ui-corereact-native-alias@everything-registry/sub-chunk-1934jawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplegix-npm-servergriffin-ui-librarykhaled-salem-custom-componentsm2m-chartjs-plugin-crosshairmama-exporterhubot-budahw9hong1-utilsinstall-isis-ten-thousandis-npm-clijordy-frijters-test-libis-hundredjrennsoh88-react-native-scroll-indicatormiscordmiscord-betamiracle-webpack-tree-shakingnative-apple-loginnew-awesome-4321native-google-loginnative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginmrexmpesa-cookieng-search-dropdownmpesa-cookie-jarnpm-all-packagesnpm-custom-lib-resuenpmtest-05041@samwinslow/edgedb@react-native-ui-design/button@rstacruz/pnpm@praella/localisationist@thinxviewx/core-rn@tonysusi/vapid@swdv-660-1w-18-fa1/chau-week1-node-project@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-expo-key-rsa-kt@taingo97/react-native-expo-rsa@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-rsa@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printer@taingo97/react-native-telpo-printer@saad27/react-native-bottom-tab-tour@saeon/logger@snyk/update-notifier@sidghimire/react-native-mapbox-navigation@sephriot/react-native-persistable-uri@status-im/react-native-transparent-videowifi_configuration_packagewhatsconcydd-parallel-cypresszeo-collectwaxmiguelweb-component-tester-bundlevue-v3-yandex-metrikawangyaling-1awodax-update-notifieryangtao-js
6.0.0

3 years ago

5.0.0

4 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.0.0

10 years ago