Accept JS file as argument and support NPM modules via jvm-npm

- HelloNashorn now takes a JS file path as command-line argument
- Uses jvm-npm (org.bsc:jvm-npm-core:1.1.0) for require() support
- Require.root set to script's parent dir so node_modules resolves correctly
- Engine created with -scripting mode for load() support
This commit is contained in:
OpenCode
2026-05-28 07:27:13 +00:00
parent 01f680d6e3
commit c74ea769a1
2 changed files with 19 additions and 7 deletions
+1
View File
@@ -9,6 +9,7 @@ repositories {
dependencies {
implementation 'org.openjdk.nashorn:nashorn-core:15.6'
implementation 'org.bsc:jvm-npm-core:1.1.0'
}
application {