Gathering detailed insights and metrics for npm-run-path
Gathering detailed insights and metrics for npm-run-path
Gathering detailed insights and metrics for npm-run-path
Gathering detailed insights and metrics for npm-run-path
Get your PATH prepended with locally installed binaries
npm install npm-run-path
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.7
Supply Chain
98.9
Quality
77.5
Maintenance
100
Vulnerability
100
License
JavaScript (79.42%)
TypeScript (20.58%)
Total Downloads
11,252,472,543
Last Day
5,888,517
Last Week
54,054,311
Last Month
284,209,185
Last Year
3,246,908,051
104 Stars
43 Commits
12 Forks
7 Watching
1 Branches
7 Contributors
Latest Version
6.0.0
Package Id
npm-run-path@6.0.0
Unpacked Size
8.44 kB
Size
2.94 kB
File Count
5
NPM Version
10.6.0
Node Version
18.20.4
Publised On
26 Aug 2024
Cumulative downloads
Total Downloads
Last day
-53.5%
5,888,517
Compared to previous day
Last week
-19.1%
54,054,311
Compared to previous week
Last month
-2.4%
284,209,185
Compared to previous month
Last year
20.7%
3,246,908,051
Compared to previous year
2
Get your PATH prepended with locally installed binaries
In npm run scripts you can execute locally installed binaries by name. This enables the same outside npm.
1npm install npm-run-path
1import childProcess from 'node:child_process'; 2import {npmRunPath, npmRunPathEnv} from 'npm-run-path'; 3 4console.log(process.env.PATH); 5//=> '/usr/local/bin' 6 7console.log(npmRunPath()); 8//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin' 9 10// `foo` is a locally installed binary 11childProcess.execFileSync('foo', { 12 env: npmRunPathEnv() 13});
options
: Options
Returns: string
Returns the augmented PATH string.
options
: Options
Returns: object
Returns the augmented process.env
object.
Type: object
Type: string | URL
Default: process.cwd()
The working directory.
Type: string | URL
Default: process.execPath
The path to the current Node.js executable.
This can be either an absolute path or a path relative to the cwd
option.
Type: boolean
Default: true
Whether to push the current Node.js executable's directory (execPath
option) to the front of PATH.
Type: boolean
Default: true
Whether to push the locally installed binaries' directory to the front of PATH.
Type: string
Default: PATH
The PATH to be appended.
Set it to an empty string to exclude the default PATH.
Only available with npmRunPath()
, not npmRunPathEnv()
.
Type: object
Default: process.env
Accepts an object of environment variables, like process.env
, and modifies the PATH using the correct PATH key. Use this if you're modifying the PATH for use in the child_process
options.
Only available with npmRunPathEnv()
, not npmRunPath()
.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 14/30 approved changesets -- score normalized to 4
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More