Skip to content

pionxzh/wakaru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

822 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Wakaru

Unpack. Unminify. Understand.

Fast JavaScript decompiler and bundle splitter for modern frontend.

CI npm Telegram

Quick Start

npx @wakaru/cli input.js -o output.js               # decompile a file
npx @wakaru/cli bundle.js --unpack -o out/          # unpack and decompile a bundle

Features

  • βœ… Bundle splitting β€” webpack 4/5, esbuild, Bun, Browserify
  • βœ… Transpiler & minifier recovery β€” Terser, Babel, SWC, TypeScript
  • βœ… Source map support for better names & import deduplication
  • βœ… Rewrite levels: minimal | standard | aggressive

Why Wakaru?

Production JavaScript is hard to read because multiple tools have transformed it:

  • Bundlers collapse many modules into one file and inject runtime wrappers
  • Transpilers downgrade modern syntax and insert helper functions
  • Minifiers erase names, fold constants, and compress control flow

Wakaru handles all three in a single command β€” feed it a bundle, get back readable modules.

Install

npm install -g @wakaru/cli

Or pre-built binaries from GitHub Releases.

CLI Reference

Decompile a single file

wakaru input.js -o output.js

Without -o, output goes to stdout. Stdin is also supported:

cat input.js | wakaru > output.js

Unpack a bundle

wakaru bundle.js --unpack -o out/
wakaru bundle.js --unpack --raw -o out/    # raw split, no readability transforms

Source maps

wakaru input.js --source-map input.js.map -o output.js

Source maps enable identifier recovery and import deduplication.

Extract original sources

wakaru extract input.js.map -o src/

Writes files embedded in the source map's sourcesContent to disk.

Rewrite level

Wakaru offers three rewrite levels so you can choose the right tradeoff for your use case:

Level When to use
minimal You need near-zero semantic changes β€” only safe, obvious transforms. Good for auditing or diffing where behavioral fidelity matters most.
standard Default. Balanced readability and correctness for most use cases.
aggressive You just want to read the code. Enables stronger intent-recovery heuristics that produce cleaner output but may alter edge-case behavior.
wakaru input.js --level minimal
wakaru input.js --level standard      # default
wakaru input.js --level aggressive

Overwrite protection

Wakaru refuses to overwrite existing files unless --force is passed.

Contributing

Every kind of contribution is welcome.

Some areas where help is especially useful:

  • Share real-world bundles that Wakaru doesn't handle well
  • Report missing helper detection or false positives
  • Report semantic or correctness issues

When reporting a bug, please include: the input code, the command you ran, the current output, and what you expected instead.

Development setup
  1. Fork the repo and create your branch from main
  2. Install a stable Rust toolchain
  3. Run cargo test to verify everything passes
  4. Make your changes and add tests

Before submitting a PR:

cargo test
cargo clippy -- -D warnings

This project uses Conventional Commits. Please mention the issue number in the commit message or PR description.

Docs: architecture.md | testing.md | helper-detection.md

License

Apache-2.0

Usage of wakaru for attacking targets without prior mutual consent is illegal. End users are responsible for complying with all applicable laws.

Contributors

Languages