🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

run-by

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-by

Figure out script is run by npm or yarn

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 24 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts