Installations
npm install nodemjs
Score
67.2
Supply Chain
94.9
Quality
76.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
mk-pmb
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.17.0
NPM Version
6.14.17
Statistics
2 Stars
19 Commits
2 Watching
2 Branches
1 Contributors
Updated on 06 May 2024
Languages
JavaScript (83.32%)
Shell (16.68%)
Total Downloads
Cumulative downloads
Total Downloads
7,593
Last day
-85.7%
1
Compared to previous day
Last week
54.5%
17
Compared to previous week
Last month
-87.8%
47
Compared to previous month
Last year
-12.5%
1,479
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Dev Dependencies
2
nodemjs
Run .mjs files from your command line, with all the tweaks from esmod-pmb.
Added features:
- Legacy-resolves module names passed with
-r
if they would otherwise yield theERR_MODULE_RESOLUTION_LEGACY
error. - Pre-imports all modules listed in env var
NODEMJS_PRELOAD
and npm settingnodemjs-preload
(see caveats below). Multiple module specs can be separated with spaces. They will be loaded even before the-r
pre-imports.
API
No.
CLI
1$ nodemjs test/uc1st.mjs 2{ scriptFile: '/mnt/…/nodemjs/test/uc1st.mjs' } 3uc1st: [ 'Using dummy input', 'Because there were', 'No CLI args' ] 4 5$ ./test/uc1st.mjs foo bar qux 6{ scriptFile: '/mnt/…/nodemjs/test/uc1st.mjs' } 7uc1st: [ 'Foo', 'Bar', 'Qux' ] 8 9$ ./test/dynamicMap.mjs rot-13 '' foo bar qux ; echo rv=$? 10dynamicMap: import failed for: rot-13 11(node:11549) UnhandledPromiseRejectionWarning: Error: Cannot find module 'rot-13' 12 at […] 13(node:11549) [DEP0018] DeprecationWarning: Unhandled promise rejections are 14 deprecated. In the future, promise rejections […] terminate […] Node.js […] 15rv=0 16 17# Fortunately, you can just pre-import the future with -r: 18$ nodemjs -r p-fatal test/dynamicMap.mjs rot-13 '' foo bar qux ; echo rv=$? 19dynamicMap: import failed for: rot-13 20Error: Cannot find module 'rot-13' 21 at […] 22rv=1 23 24# … or via the env var: 25$ export NODEMJS_PRELOAD='p-fatal' 26$ ./test/dynamicMap.mjs rot-13 '' foo bar qux ; echo rv=$? 27dynamicMap: import failed for: rot-13 28Error: Cannot find module 'rot-13' 29 at […] 30rv=1 31 32# and once you've installed it… 33$ ./test/dynamicMap.mjs rot-13 '' foo bar qux 34[ 'sbb', 'one', 'dhk' ]
Setup
npm install --global nodemjs
- Make sure you have a node.js (compatible) binary available as the
nodejs
command. If you use sane package sources, you probably do. If you don't, just make a symlinknodejs
tonode
or whatever it's called on your system.
(If you'd like to argue the supremacy of the more genericnode
command name, file an issue, ideally after you've renamed the Node.js foundation to Node foundation.)
As of 0.1.7, you can configure your favoritenodejs
replacement via theNODEJS_CMD
env var.
Known issues
-
Currently no support for setting
process.mainModule
, see the upstream bug ticket. -
npm config caveat: The
nodemjs-preload
npm setting is currently ignored if its value as a string is literallyundefined
. If you want to pre-load a module with that name and nothing else, put it in twice, with a space between. See also: Duplicate pre-imports. -
Duplicate pre-imports:
nodemjs
currently does not check whether a module you're trying to pre-import had already been imported before. Usually node's module cache voids all non-first import attempts per module, so this won't matter — unless you use cache-busting modules, in which case you're on your own. -
REPL: The REPL isn't upgraded to ESM because
esm
currently cannot expose its REPL in a clean and easy way. -
The
invokedAs
context property fornodemjsCliMain
doesn't work. -
Needs more/better tests and docs.
Â
License
ISC
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2024-11-18
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