js-beautify
Reformats and re-indents JavaScript, HTML, and CSS into clean, readable code
Repository Health
Technical Analysis
js-beautify is a long-running, widely used code formatter that takes minified, obfuscated, or inconsistently indented JavaScript, HTML, or CSS and reformats it into readable, consistently indented source. It ships as a Node.js library with a CLI (js-beautify, css-beautify, html-beautify), a browser-embeddable script, and a companion Python package (jsbeautifier), and it also partially deobfuscates scripts packed by common packers.
It has been maintained since 2008 and is the formatting engine behind the popular beautifier.io web tool, embedded in countless editor extensions and dev tool integrations that need to pretty-print arbitrary JS/HTML/CSS on the fly.
What You Get
- A
js-beautifyCLI plus dedicatedcss-beautifyandhtml-beautifyexecutables for formatting files or piped stdin - A Node.js library API (
beautify.js,beautify.css,beautify.html) for programmatic formatting inside build tools or editors - A browser-ready bundle (via cdnjs) exposing
js_beautify,css_beautify, andhtml_beautifyglobals - A parallel Python implementation (
jsbeautifier/cssbeautifier) with matching CLI and library interfaces - Partial deobfuscation of scripts packed by Dean Edwards’ packer and related tools
- Extensive configuration via
.jsbeautifyrc/EditorConfig for indent size, brace style, wrap length, and templating languages
Common Use Cases
- Reformatting minified or obfuscated third-party JavaScript for readability during debugging
- Powering an editor extension or IDE’s built-in “format document” command
- Normalizing code style in a build pipeline before further static analysis
- Embedding a formatter in a browser-based code playground or snippet tool
Under The Hood
Architecture - The codebase splits into three parallel beautifiers (js/src/javascript, js/src/css, js/src/html) that share a common tokenizing core in js/src/core (tokenizer.js, token.js, inputscanner.js, pattern.js, output.js). Each language beautifier tokenizes input into a stream, walks it applying indentation/brace-style rules from options.js, and re-emits formatted output via the shared output.js writer; a mirrored Python implementation under python/jsbeautifier and python/cssbeautifier reimplements the same core/tokenizer pattern for the pip-installable CLI. Tech Stack - Plain JavaScript (no framework), packaged for Node via js/index.js with CLI entrypoints under js/bin/, plus webpack-based bundling (webpack.config.js) for the browser distribution; the Python port depends only on the standard library. Runtime dependencies are minimal (config-chain, editorconfig, glob, js-cookie, nopt). Code Quality - Tests live under js/test/ (node, AMD, and browser “sanity” suites) and python/*/tests, covering each beautifier against fixture data in test/data/{javascript,css,html}; the project has run for over a decade with 3,300+ commits and 275 contributors, though the README itself flags that it is under-resourced for its popularity and actively seeking maintainers. API Design - The library API is a thin, well-documented beautify(code, options) signature mirrored across JS, Python, and CLI surfaces with underscore-cased option names matching CLI flag names one-to-one, which keeps the developer experience consistent across all four distribution channels (Node, browser, Python, CLI).
Used by 11 apps in this directory
agenta
Developer Tools · Devops · AI Development
The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.
LimeSurvey
Forms Surveys
The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.
listmonk
Marketing · Blogging
High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.
medusa
Ecommerce
The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.
Omnivore
Knowledge Management · Bookmarks Archiving · Note Taking
Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.
OpenObserve
Monitoring · Analytics · Devops
Open source observability platform for logs, metrics, traces, and real user monitoring — delivering 140x lower storage costs than Elasticsearch with a single binary you can run in under 2 minutes.
Penpot
Design Tools
Open-source design platform with GPU-accelerated canvas, native design tokens, and MCP-powered AI workflows for teams that ship fast.
RSSHub
Automation · Social Media
Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.
Sentry
Security · Developer Tools · Monitoring
Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.