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_samplegriffin-ui-librarytest-library-123test-haptik-libwodax-update-notifierweb-component-tester-bundlewifi_configuration_packagewhatsconcrn-tm-notifyrn-currency-formatterrn-counter-demorn-session-multiplier-demorn_unique_device_idrnttlockscout-chatbot-widgetreactnativelyrfp-librn-check-btnrn-circular-chartrn-adyen-dropinstarringreact-native-wtfreact-native-version-appreact-native-withframework-checksemantic-release-gitmoji-actiontest-zeo-collectvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactvite_vue3_ts_ssssdddddyyyy3.0.0jawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarquickcapture_react_nativern-agora-ios-mmiracle-webpack-tree-shakingmiscordmiscord-betagix-npm-serverjesh-calculationjrennsoh88-react-native-scroll-indicatoris-ten-thousandinstall-isis-npm-cliis-hundredm2m-chartjs-plugin-crosshairmpesa-cookiempesa-cookie-jarhubot-budahw9khaled-salem-custom-componentsjordy-frijters-test-libhong1-utilsmrexmama-exporterpackage-engines-notifierreact-native-rom-componentsori-bot-react-nativeover-armour-masterproject-wajs-dvpolen-web-components-react
6.0.0

3 years ago

5.0.0

5 years ago

4.0.0

5 years ago

3.0.0

6 years ago

2.0.0

7 years ago

1.0.0

10 years ago