wakaru
v1.8.0
Published
JavaScript decompiler — unpack bundles and turn minified, transpiled production code back into readable modules. Written in Rust.
Maintainers
Readme
wakaru
wakaruis the bare-name alias for@wakaru/cli: the same CLI under a shorter name.
Turn production JavaScript — bundled, transpiled, minified — back into readable modules.
Quick Start
npx wakaru input.js -o output.js # decompile a file
npx wakaru bundle.js --unpack -o out/ # unpack and decompile a bundle
npx wakaru dist/ --unpack -o out/ # scan a bundle output directoryInstall
npm install -g wakaru@latest
wakaru input.js -o output.jsWhat It Does
- Splits webpack 4/5 bundles (including supported Vercel ncc output), esbuild, Bun, Browserify (including Cocos Creator 2.x), Closure ModuleManager, SystemJS, and AMD/UMD, plus scope-hoisted Rollup/Vite output.
- Recovers readable JavaScript from transpiler and minifier output.
- Supports source maps for name recovery and output mappings.
- Offers
minimal,standard, andaggressiverewrite levels. - Deliberately not a deobfuscator — obfuscated input should have the obfuscation stripped with a dedicated tool first.
CLI Reference
Decompile a single file
wakaru input.js -o output.js
cat input.js | wakaru > output.jsWithout -o, output goes to stdout. Stdin is supported for single-file
decompilation.
Unpack bundles and chunks
wakaru bundle.js --unpack -o out/
wakaru bundle.js --unpack --raw -o out/
wakaru bundle.js --unpack=strict -o out/
wakaru entry.js chunk.js --unpack -o out/
wakaru dist/ --unpack -o out/--unpacksplits detected bundles and then decompiles each module.--unpack --rawwrites extracted modules before the readability pipeline.--unpack=strictuses structural bundle detection without heuristic fallback.- Directory inputs are recursive and detect-only; skipped files are not copied.
Formatter
wakaru input.js --formatter -o output.js
wakaru bundle.js --unpack --formatter -o out/--formatter runs a final formatting pass after decompilation. It is off by
default.
Source maps
wakaru input.js --source-map input.js.map -o output.js
wakaru input.js --emit-source-map -o output.js--source-map improves name recovery from the original source map.
--emit-source-map writes a .map file that maps the decompiled output back to
the input.
Extract original sources
wakaru extract input.js.map -o src/Writes files embedded in a source map's sourcesContent to disk.
Rewrite levels and cleanup
wakaru input.js --level minimal
wakaru input.js --level standard
wakaru input.js --level aggressive
wakaru input.js --dceminimalkeeps to high-confidence, low-risk rewrites.standardis the default readability-oriented mode.aggressiveenables more speculative generated-code recovery.--dceopts into a full dead-code reachability sweep.
JSON, diagnostics, and profiling
wakaru bundle.js --unpack --json -o out/
echo 'var a=1;' | wakaru --json
wakaru input.js --diagnostics
wakaru input.js --profile trace.json
wakaru input.js --profile trace.json --profile-rules--jsonwrites structured JSON to stdout.--diagnosticsreports post-transform warnings to stderr.--profilewrites a Chrome trace file.--profile-rulesincludes per-rule timings in the trace.
Overwrite protection
Wakaru refuses to overwrite existing files unless --force is passed.
Links
- Website: https://wakarujs.com
- Playground (runs in your browser): https://wakarujs.com/playground
- Repository: https://github.com/pionxzh/wakaru
- Documentation: https://github.com/pionxzh/wakaru#readme
- Releases: https://github.com/pionxzh/wakaru/releases
