6.0.0 • Published 4 years ago

is-npm v6.0.0

Weekly downloads
8,217,903
License
MIT
Repository
github
Last release
4 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_packagewhatsconcstarringtest-zeo-collectvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactvite_vue3_ts_ssssdddddyyyyjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libinstall-isis-hundredis-ten-thousandis-npm-clikhaled-salem-custom-componentshw9hubot-budahong1-utilsmama-exporterm2m-chartjs-plugin-crosshair@wecraftapps/react-native-use-keyboard@tlgeo/react-native-gdal@thinxviewx/core-rn@tonysusi/vapid@vandai-nguyen/module_test@yathomasi/cypress-parallel@xiwen5566/aqara-automation-switch@yiminghe/update-notifier@yplabs-ltd/react-native-detector@zotasys/nativeagent-get-agentawesome-react-starsawesome-module-kdarchlibraryarvm-bestdeveloper@oiti/rn-liveness2d@orgbluetooth/react-native-arunpayupayment@orgbluetooth/react-native-payupayment@ponchodien/react-native-printer-imin@orschweitzer/git-clone-packagegenz-native-elementsframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newgdphpttgaurav-react-native-loopgamification-integration-new@sridharetikala/react-native-rn-lib-custom-components@status-im/react-native-transparent-video@swdv-660-1w-18-fa1/chau-week1-node-project@syedt/hellosdk@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
6.0.0

4 years ago

5.0.0

6 years ago

4.0.0

6 years ago

3.0.0

7 years ago

2.0.0

8 years ago

1.0.0

11 years ago