Registry / devops / n4js-cli

n4js-cli

JSON →
library0.37.9jsnpmunverified

Command-line interface for the N4JS language, including the compiler and build tools. Current version is 0.37.9, with monthly releases following the N4JS project cadence. It provides a CLI to compile N4JS code to JavaScript, and supports custom runtimes. Differentiators include deep integration with the Eclipse ecosystem and a static type system targeting JavaScript. Note: this is a niche tool; for mainstream use, consider TypeScript or other transpilers.

npm install n4js-cli
INSTALL
IMPORT
SIG · N4JS-CLI
N
n4js-cli
devopsjavascriptv0.37.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

n4jsc.jar
n4js-cli invokes the Java CLI; no import in JS/TS code. Use as a command-line tool via `npx n4js-cli`.
import { n4js } from 'n4js-cli';
n4js-cli is a CLI tool, not a library. Do not import it in JavaScript/TypeScript code.
n4js-cli (global command)
npm install -g n4js-cli then run `n4js-cli compile`
const n4js = require('n4js-cli');
It's a CLI binary, not a Node.js module. Use globally or via npx.

Demonstrates installing n4js-cli globally and compiling N4JS source files to JavaScript.

// n4js-cli is a CLI tool, not a library. // Install globally: // npm install -g n4js-cli // Then compile N4JS files: // n4js-cli compile src/ -d out/ // Alternative using npx: // npx n4js-cli compile src/ -d out/
n4jsc --version
Debug
Known issues
gotchan4js-cli requires Java Runtime Environment (JRE) 8+ to execute the underlying n4jsc.jar.
fix
Install JRE 8 or later and ensure java is in PATH.
affects: all
gotchaThe package is a CLI tool; it cannot be imported as a JavaScript module.
fix
Use it via command line: `npx n4js-cli` or global install.
affects: all
deprecatedOlder versions (pre-0.25) used a different command structure; ensure documentation matches installed version.
fix
Upgrade to latest version and refer to current CLI help: `n4js-cli --help`
affects: <0.25
Errors
Common errors & fixes
Error: Could not find or load main class org.eclipse.n4js.n4jsc.Main
n4jsc.jar is missing or corrupted; environment variable N4JSC_JAR not set correctly.
fix
Ensure n4jsc.jar is present in the package or set N4JSC_JAR to a valid path/URL.
n4js-cli: command not found
n4js-cli not installed globally or not in PATH.
fix
Install globally: `npm install -g n4js-cli` or use npx: `npx n4js-cli`
Upgrade
Version history
0.37.9latest on npm
Audit
Dependencies
javaoptionalN4JS CLI wraps a Java-based compiler (n4jsc.jar); requires Java Runtime Environment (JRE) 8 or later to execute the jar.
Agent activity
4 hits · last 30 days
node
4
Resources
n4js-cli — npm install n4js-cli · libregistry