webdev_javascript_beautifier
Pretty-print minified or messy JavaScript with configurable indentation, brace style, and spacing. Makes JS code readable without external services.
Instructions
JavaScript Beautifier. Pretty-print and re-indent minified or messy JavaScript with configurable indent (spaces or tabs), brace style, parenthesis spacing, and newline preservation. Use it to make JS readable; use webdev_js_minifier for the reverse (shrink for production), and webdev_code_formatter when you also need HTML/CSS in one pass. Runs locally on the code you provide: read-only, non-destructive, offline, contacts no external service, and is rate-limited. Returns the formatted code, token-count stats, and heuristic syntax warnings (it does not transpile or fully validate).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The JavaScript source to beautify (also accepted as "input"). | |
| options | No | Formatting options. Omit for defaults. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| formattedCode | No | The beautified, re-indented JavaScript. | |
| stats | No | Token counts derived from the formatted code. | |
| validationErrors | No | Heuristic syntax warnings (missing semicolons, unmatched quotes/braces); empty when none. |