jscd
Reverse bytenode-compiled .jsc files back to JavaScript.
Static parsing only: one pure-Rust binary — no patched V8, no Node runtime, no network.
Supports Node 8.0.0 → 26.13.0 (519 releases / 36 V8 minors) and Electron 11 and 19 → 45.2
(V8 8.7 – 15.6, pointer-compressed and sandboxed builds included; Electron 11 and every
major from 20 to 45 pass the same 9-fixture behavior check, 9/9 each); ≈ 25k .jsc files pass the
tests with 0 failures (32 Node lines × 41 fixtures, compiled with bytenode 1.7.0's flags); two
optimization layers (register folding → cure simplification) make the decompiled source readable.
English · 中文
Contents: Highlights · Quick start · Install ·
Usage · CLI reference · Supported versions ·
How it works · Verification · Repository layout ·
Limitations · Contributing
Highlights
- Coverage — every Node release from 8.0.0 → 26.13.0 (519 releases / 36 V8 minors) is
identified; a V8 outside the tables is a clear error, not a guess.
- Runnable output —
--runtime adds the __runtime stubs so the result runs under node;
--verify puts it through node --check.
- Readable output — two optimization layers fold bytecode register shuffling back into
expressions (register folding → cure simplification);
JSCD_NO_OPT=1 shows the raw form.
- Names recovered — scope slots are named, builtins resolved through a read-only-heap name
table; never an identifier that throws
ReferenceError.
- One dependency-free binary — pure Rust: no Node, no network, no patched V8; the Linux build
is a 2.8 MB static binary (UPX).
- Reproducible verification — 32 Node lines × 41 fixtures compared case by case, plus corpus
sweeps; every number rerunnable (see Verification).
Quick start
$ cat hello.js
function greet(name) {
return "hello " + name;
}
console.log(greet("world"));
$ npm i -g bytenode && bytenode -c hello.js # Node 20.20.2 in this transcript
$ xxd -l 48 hello.jsc
00000000: cc05 dec0 0bc2 e400 9200 0000 e521 2eaa .............!..
00000010: f002 0000 0000 0000 011c 5401 2006 a860 ..........T. ..`
00000020: 0000 0000 0600 0000 010c 4c60 0000 0000 ..........L`....
$ jscd hello.jsc
console.log(greet("world"));
function greet(a0) {
return "hello " + a0;
}
$ jscd hello.jsc --runtime > hello.out.js && node hello.out.js
hello world
jscd info hello.jsc decodes that header (sample in Usage); JSCD_NO_OPT=1 prints the
raw, pre-optimization form instead.
Install
macOS / Linux — Homebrew
brew install ejfkdev/tap/jscd
Any platform — npm (Node.js 18+)
npm install -g @ejfkdev/jscd
The package downloads the matching release binary and verifies its SHA-256, so no Rust toolchain is
needed. Set JSCD_BINARY_PATH to use a local binary instead.
Windows — WinGet
winget install --id ejfkdev.jscd -e
winget upgrade --id ejfkdev.jscd -e
The manifest lives in ejfkdev/release-automation;
the current manifest submission is awaiting review in
microsoft/winget-pkgs#453064. Until it is
merged, use Scoop, npm, or the release binary.
Windows — Scoop
scoop bucket add ejfkdev https://github.com/ejfkdev/scoop-bucket
scoop install jscd
Straight from the manifest URL, without adding the bucket first:
scoop install https://raw.githubusercontent.com/ejfkdev/scoop-bucket/main/bucket/jscd.json
Prebuilt binaries — Releases.
cargo (any platform with Rust 1.96+)
cargo install jscd # build from crates.io
cargo binstall jscd # or fetch the release binary instead of compiling (cargo-binstall)
From source
cargo install --git https://github.com/ejfkdev/jscd # latest main
git clone https://github.com/ejfkdev/jscd && cd jscd
cargo build --release # -> target/release/jscd
cargo install --path . # ...or install that build into ~/.cargo/bin
Requires Rust 1.96+ (the workspace toolchain pin; cure itself needs 1.74). No system dependencies.
Releasing (maintainers)
scripts/release.sh vX.Y.Z runs the release gates (cargo test --release,
clippy --all-targets -- -D warnings, and the end-to-end smoke scripts/ci_smoke.sh — fixtures
compiled to real .jsc, decompiled, syntax-gated and run-compared), then pushes an annotated
tag whose message becomes the GitHub Release description. The tag triggers
.github/workflows/release.yml, which rebuilds the six bare binaries listed above. Then
cargo publish to crates.io (release.sh keeps the tag and the Cargo.toml version in sync), and
python3 scripts/update_readme_help.py to refresh the CLI help below; the
Homebrew tap and the
Scoop bucket pick the new release up on their daily
auto-update run.
Usage
jscd app.jsc # decompile one file to stdout
jscd app.jsc app.js # ...to a file
jscd dist/ # every .jsc under dist/ → dist-out/ (tree mirrored)
jscd dist/ out/ # ...into out/ instead
jscd info app.jsc # header fields, detected Node/V8 version
jscd disasm --filter main app.jsc
jscd ro-map probe.jsc > m.json # build a read-only-heap name table
jscd --help # bilingual help (-h, `help`, `help <SUBCOMMAND>`)
- Input is one
.jsc file, or a directory scanned recursively for *.jsc; output defaults
to stdout for a file and to <INPUT>-out/ (tree mirrored) for a directory — -o / the OUTPUT
argument writes elsewhere, - means stdout.
- A
.jsc from an unsupported V8 is rejected with the detected version and the supported range
in the message (jscd info prints supported: yes|no) — never a silent, runtime-only file.
- Read-only-heap names (Node 22+) resolve automatically where an embedded table applies (macOS,
non-pointer-compressed builds); elsewhere build one with
jscd ro-map and pass --ro-map
(JSCD_NO_RO_MAP=1 disables the embedded table). Embedded tables are never applied to
pointer-compressed caches (Electron/Chrome): they share the V8 version string with Node but lay
the read-only heap out differently. The same table also pins string roots (roots): their
indices shift between builds, so a table from your own build turns "0" back into "0" instead
of whatever another build stored at that index. Platform / tagged-size mismatches are ignored;
even the same V8 version string can come from a different Node patch build (-node.NN) with
shifted read-only-heap addresses, so if names show up as <ro…> placeholders, build a table with
your own probe.
- The interface language follows
JSCD_LANG (then LC_ALL / LC_MESSAGES / LANGUAGE / LANG /
LC_CTYPE): zh* is Chinese, anything else English; JSCD_LANG=zh|en forces one.
| Flag |
Applies to |
Effect |
-o, --output <PATH> |
all forms |
output file / directory / - (same as the OUTPUT argument) |
--quiet |
directory input |
suppress per-file progress |
--json |
all subcommands |
machine-readable output |
--filter <SUBSTR> |
disasm |
only emit functions whose name contains SUBSTR |
--ro-map <PATH> |
decompile |
read-only-heap name table produced by jscd ro-map |
--verify |
decompile |
syntax gate: run the result through node --check (needs node on PATH) |
--runtime |
decompile |
keep the runnable preamble (__runtime stubs, flattened context vars, name aliases). Off by default — add it when you want to run the product with node |
--skip-oversized <N> |
decompile |
emit a stub for functions whose bytecode is longer than N bytes |
--continue-on-error |
decompile |
emit a stub and keep going when one function fails |
-h, --help |
all forms |
print help (jscd help <SUBCOMMAND> for one command) |
-v, -V, --version |
all forms |
print name, version and repository |
CLI reference
Everything the CLI prints for --help and help <SUBCOMMAND>, verbatim (regenerate with python3 scripts/update_readme_help.py).
Full CLI help — jscd --help and every subcommand, verbatim
jscd --help
$ jscd --help
jscd 0.3.3 — V8 code cache → JavaScript
https://github.com/ejfkdev/jscd (MIT license)
Reconstructs JavaScript from bytenode-compiled .jsc files (V8 code caches).
Static parsing — no patched V8, no Node runtime. Directories are scanned
recursively.
Usage: jscd [OPTIONS] <INPUT> [OUTPUT] # decompile (default action)
jscd <SUBCOMMAND> [ARGS...] # stage-by-stage analysis
jscd help [SUBCOMMAND] | version | -h | -v | -V
INPUT a .jsc file, or a directory (scanned recursively for *.jsc).
OUTPUT a file, a directory, or `-` for stdout:
<file.js> one input file
<dir> directory input, tree mirrored
default: stdout for a file; <INPUT>-out/ next to it for a directory
Options:
-o, --output <path> output file / directory / - (same as OUTPUT)
--ro-map <path> read-only-heap name table (decompile)
--verify syntax-gate the result with `node --check` (decompile)
--runtime keep the runnable prelude (`__runtime` stubs) so the output
can be run with node; off by default — the output is
then just the reconstructed code
--skip-oversized <N>
emit a stub for functions whose bytecode is longer than N
bytes (decompile)
--continue-on-error
emit a stub and keep going when one function fails
(decompile)
--filter <substr> only functions whose name contains substr (disasm)
--json machine-readable output (info/strings/functions/disasm/ro-map)
--quiet suppress per-file progress (directory input)
-h, --help print this help
-v, -V, --version print name, version, repository
JSCD_LANG=zh|en force the help/error language (default: auto-detect)
Subcommands:
decompile reconstruct JavaScript (default action: `jscd <INPUT>`)
info header fields and the detected Node/V8 version
strings string and symbol constants from the constant pools
functions SharedFunctionInfo tree (names, params, bytecode sizes)
disasm bytecode disassembly (View8-compatible text)
ro-map build a read-only-heap name table from a probe cache
help print help (`jscd help <SUBCOMMAND>`)
version print name, version and repository
Examples:
jscd app.jsc decompile to stdout
jscd app.jsc app.js decompile to a file
jscd dist/ dist/**.jsc → dist-out/**.js
jscd dist/ out/ ... into out/ instead
jscd decompile --ro-map m.json a.jsc with a name table
jscd info app.jsc header fields and V8 version
jscd disasm --filter main app.jsc one function's bytecode
jscd help disasm per-subcommand help with examples
jscd ro-map probe.jsc -o names.json
build a name table (see `jscd help ro-map`)
jscd help decompile