Skip to content
/ run-by Public

Figure out if the script is run by npm or yarn

License

Notifications You must be signed in to change notification settings

sidoshi/run-by

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

run-by

Build Status contributions welcome HitCount npm npm

Figure out script is run by npm or yarn

Install

npm install --save run-by

Usage

import runBy from 'run-by'

API

isYarn: boolean

True if the script is started with yarn

isNpm: boolean

True if script is started with npm

runner: ?string

It's value will be one of npm, yarn or null depending on how the script has started. If the script is started with node, runner will be null.

runBy(execPath: string): RunBy

It takes the exec_path env, by default is process.env.npm_execpath. Returns isYarn, isNpm and runner depending on the execpath.

License

MIT © Siddharth Doshi

About

Figure out if the script is run by npm or yarn

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published