Figure out script is run by npm or yarn
npm install --save run-by
import runBy from 'run-by'
True if the script is started with yarn
True if script is started with npm
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
.
It takes the exec_path env, by default is process.env.npm_execpath
.
Returns isYarn
, isNpm
and runner
depending on the execpath
.
MIT © Siddharth Doshi