Gathering detailed insights and metrics for run-node
Gathering detailed insights and metrics for run-node
Gathering detailed insights and metrics for run-node
Gathering detailed insights and metrics for run-node
npm install run-node
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.9
Supply Chain
78
Quality
75.4
Maintenance
100
Vulnerability
100
License
Shell (100%)
Total Downloads
295,742,389
Last Day
63,950
Last Week
483,587
Last Month
2,632,265
Last Year
29,536,761
138 Stars
18 Commits
10 Forks
7 Watching
1 Branches
6 Contributors
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
Cumulative downloads
Total Downloads
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
No dependencies detected.
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 run-node
$ ./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.
Download the run-node file:
$ curl -sSLO https://github.com/sindresorhus/run-node/raw/master/run-node && chmod +x run-node
./run-node file.js
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.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
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
Reason
detected GitHub workflow tokens with excessive permissions
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