Skip to content
yutils
Example

Input (minified JS)

function add(a,b){return a+b}const result=[1,2,3].map(x=>x*2).filter(x=>x>2);console.log(result);

Output (formatted)

function add(a, b) {
  return a + b
}
const result = [1, 2, 3]
  .map(x => x * 2)
  .filter(x => x > 2);
console.log(result);

Note

Whitespace only — variable names and logic are untouched. For accurate minification use a dedicated tool like terser.

Usage / FAQ

When to use

  • Restore readability of minified bundle.js for debugging
  • Indent AI-generated one-liner JS / inline functions
  • Tidy JS before pasting into issues, Slack, or Notion
  • Visualize complex method chains and arrow functions
  • Use minify mode for a first-pass production compress

FAQ

Q.Does this replace a real minifier?
A.No — this tool only handles indentation. For true production minify (name mangling, dead-code elimination, …) use terser, esbuild, or swc.
Q.Does it handle TypeScript?
A.It is JS-beautify based. TS-only syntax (`as`, generics like `<T>`) can produce incorrect results. Use Prettier or Biome for proper TS formatting.
Q.What about JSX?
A.Plain JS is the baseline; JSX often works but complex structures may not look great.
Fun facts
  • JavaScript was created by Brendan Eich at Netscape in 1995 — in 10 days. A marketing brief to 'make it look like Java' is why the syntax resembles Java, while the semantics are Scheme + Self. That mismatch produced lasting hazards like ASI (Automatic Semicolon Insertion).

    Brendan Eich — Popularity
  • Before Prettier (2017, James Long), 'tabs vs spaces' and 'semicolons vs no semicolons' fights had dragged on for decades. Prettier's slogan, 'opinionated,' is the deliberate position — end the debate at the tool level by making options minimal.

    Prettier 0.0.10 release
  • Linter and formatter aren't the same — ESLint-style linters catch bug-prone patterns, while Prettier-style formatters enforce visual consistency. The modern JS stack runs both, with `eslint-config-prettier` resolving rule conflicts between them.

    Prettier — vs Linters