RevealTheme logo

Formateador de JavaScript

Formatea JavaScript minificado con sangría y saltos de línea en los puntos y comas y las llaves.

Cómo usar esta herramienta

  1. 1

    Paste or type your JavaScript into the input textarea.

  2. 2

    Watch the indented version appear live in the output box below as you type — there is no Format button.

  3. 3

    Select the formatted text in the output box and copy it with your keyboard (there is no copy button).

  4. 4

    Scan the result for any line that split inside a string, regex, or comment, and fix those by hand if needed.

¿Qué es el Formateador de JavaScript?

Los paquetes minificados eliminan todos los espacios en blanco: útil para una entrega rápida, doloroso para leer. Este formateador básico restaura la sangría y rompe las líneas en los puntos y comas y las llaves. Para un reformateo de calidad de producción que conserve los comentarios y respete las reglas de ASI, usa Prettier o el formateador integrado de tu editor.

Casos de uso comunes

  • Eyeballing a minified vendor bundle or one-line snippet to see its rough structure before debugging.

  • Quickly indenting a short config or object literal you pasted from a chat message or log line.

  • Spreading a dense JSON-like object across multiple lines so nesting becomes visible.

  • Teaching or demoing how braces and semicolons map to indentation levels for beginners.

  • Making a compressed third-party script readable enough to locate a specific function or variable.

  • Sanity-checking that brackets are balanced, since unbalanced input leaves the indentation visibly skewed.

Preguntas frecuentes

¿Es tan bueno como Prettier?
No: esto es un arreglo visual rápido. Prettier es un formateador adecuado basado en un analizador que gestiona casos límite que este no.

Herramientas relacionadas