wakaru

Recover readable JavaScript modules from minified and bundled code.

948|41|Updated Jan 28, 2023
One-click install
npx skills add https://github.com/pionxzh/wakaru --skill wakaru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wakaru
Source: https://github.com/pionxzh/wakaru/tree/main
Command: npx skills add https://github.com/pionxzh/wakaru --skill wakaru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires swc, wasm-bindgen, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill transforms minified, bundled, or transpiled JavaScript back into readable modules, allowing for easier reading, auditing, debugging, and recovery of source code.

Core Features & Use Cases

  • Bundle Splitting: Decompose webpack, esbuild, Bun, Browserify, SystemJS, AMD, and Rollup/Vite bundles into individual modules.
  • Transpiler Recovery: Reverse Babel, TypeScript, and SWC runtime helpers like async/await, classes, JSX, enums, optional chaining, etc.
  • Minifier Recovery: Undo minification artifacts like sequence expressions, flipped comparisons, and alias inlining.
  • Source Maps: Utilize source maps for name recovery and import deduplication.
  • Rewrite Levels: Offers three levels of rewrites: minimal, standard, and aggressive, allowing users to balance readability and semantic correctness.
  • Use Case: Imagine you have a minified JavaScript bundle from a production application. Use this Skill to unpack and decompile the bundle, making it easier to understand and audit the code.

Quick Start

To decompile a JavaScript file, run the following command:

wakaru input.js -o output.js

Frequently Asked Questions about wakaru

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unminify and split a bundled JavaScript file into readable modules?

To unminify and unpack bundled JavaScript, use the wakaru command-line tool to process the input file, splitting webpack or esbuild bundles into individual readable modules. It reverses minification artifacts and transpiler helpers for easier source recovery.

What is the best way to recover source code from a transpiled JavaScript bundle?

Recovering source code from a transpiled JavaScript bundle involves reversing Babel, TypeScript, and SWC runtime helpers like async/await and JSX. This process restores the original readable syntax by undoing compiler artifacts and alias inlining from the minified production output.

Does source map support help with JavaScript decompilation and name recovery?

Yes, source map support aids JavaScript decompilation by utilizing the map files for variable name recovery and import deduplication. This allows the unpacking process to restore original identifiers that were mangled during the minification and bundling stages.

Can I unpack webpack and Vite bundles without losing semantic correctness?

You can unpack webpack and Vite bundles while balancing readability and semantic correctness using three rewrite levels: minimal, standard, and aggressive. These options allow you to control how deeply the decompilation reverses minification artifacts.

What are the limitations when reversing minification artifacts in production JavaScript?

Limitations when reversing minification artifacts in production JavaScript include potential semantic shifts during aggressive rewrites. While sequence expressions and flipped comparisons are reversed, highly obfuscated code may not fully restore its original readability without a corresponding source map.