Installations
npm install run-node
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=10
Node Version
10.18.1
NPM Version
6.13.4
Score
97.9
Supply Chain
78
Quality
75.4
Maintenance
100
Vulnerability
100
License
Contributors
Unable to fetch Contributors
Languages
Shell (100%)
Developer
sindresorhus
Download Statistics
Total Downloads
295,742,389
Last Day
63,950
Last Week
483,587
Last Month
2,632,265
Last Year
29,536,761
GitHub Statistics
138 Stars
18 Commits
10 Forks
7 Watching
1 Branches
6 Contributors
Sponsor this package
Package Meta Information
Latest Version
2.0.0
Package Id
run-node@2.0.0
Size
2.90 kB
NPM Version
6.13.4
Node Version
10.18.1
Publised On
22 Feb 2020
Total Downloads
Cumulative downloads
Total Downloads
295,742,389
Last day
-28.5%
63,950
Compared to previous day
Last week
-9.7%
483,587
Compared to previous week
Last month
-28%
2,632,265
Compared to previous month
Last year
-12.8%
29,536,761
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
run-node
Run the Node.js binary no matter what
You can't always assume running $ node file.js
will just work. The user might have the node
binary in a non-standard location. They might be using a Node.js version manager like nvm
, which is sourced in a subshell and not available from the outside. Or they might have node
installed as a local dependency in an npm project. It also depends from where you're trying to run it. For example, GUI apps on macOS doesn't inherit the $PATH
, so the node
binary would not be found. Most projects that depend on Node.js just end up telling the user to manually set the full path to the node
binary in some project specific settings. Now every project has to do this. Ugh... I prefer things to just work. With this module it will.
This Bash script uses some tricks to find the Node.js binary on your system and run it.
Can be used from any environment that can spawn a process (Shell, Python, Ruby, Swift, Objective-C, etc).
npm
Install
$ npm install run-node
Usage
$ ./node_modules/.bin/run-node file.js
Or in an npm run script:
1{ 2 "start": "run-node file.js" 3}
If the node
package is found in the local node_modules
directory (for instance, if you have it installed as a devDependency of your npm project), this is the node
binary that will be used.
Manually
Install
Download the run-node file:
$ curl -sSLO https://github.com/sindresorhus/run-node/raw/master/run-node && chmod +x run-node
Usage
./run-node file.js
Customizable cache path and error message
The cache path and error message are defined by the RUN_NODE_CACHE_PATH
and RUN_NODE_ERROR_MSG
environment variables. You could use them in a script or add them to your ~.bashrc
.
Default config:
1export RUN_NODE_ERROR_MSG="Couldn't find the Node.js binary. Ensure you have Node.js installed. Open an issue on https://github.com/sindresorhus/run-node" 2export RUN_NODE_CACHE_PATH="/home/username/.node_path"
If the RUN_NODE_CACHE_PATH
environment variable is defined explicitly, the script it points to will be sourced before looking for a node
binary. You can use this script to override your PATH
variable so that a specific node
binary is found.
Maintainers
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 4/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/run-node/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/run-node/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
4.2
/10
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