if-npm
v0.0.2
Published
Check if your code is running as an npm or yarn project
Downloads
1
Maintainers
Readme
if-npm
- Check if your code is running as an npm or yarn script
Install
- You must install the package on your project
npm install if-npm
Usage
import {isNpmOrYarn, isNpm, isYarn} from 'if-npm';
console.table({isNpmOrYarn, isNpm, isYarn});
$ node kar.js
# ┌─────────────┬────────┐
# │ (index) │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │ false │
# │ isNpm │ false │
# │ isYarn │ false │
# └─────────────┴────────┘
$ npm run kar
# ┌─────────────┬────────┐
# │ (index) │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │ true │
# │ isNpm │ true │
# │ isYarn │ false │
# └─────────────┴────────┘
$ yarn run kar
# ┌─────────────┬────────┐
# │ (index) │ Values │
# ├─────────────┼────────┤
# │ isNpmOrYarn │ true │
# │ isNpm │ false │
# │ isYarn │ true │
# └─────────────┴────────┘
Contact
- Contact With Me Discord :
Karlos#4123