js-beautify

Reformats and re-indents JavaScript, HTML, and CSS into clean, readable code

Tool
npm
v2.0.3
8,999 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
86 /100 Excellent
Development Activity 88
Maintenance 68
Community 88
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 78
Code Quality 72
Innovation 70
Learning Curve 82

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-beautify CLI plus dedicated css-beautify and html-beautify executables 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, and html_beautify globals
  • 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

TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 6 days ago
JavaScript
43%
Other

LimeSurvey

Forms Surveys

3,736

The world's most flexible open-source survey platform with 900+ templates, conditional logic, 80+ languages, and full GDPR compliance for any scale.

View details
86
Repo Health
62
Technical
63
Dependency
Built with
JavaScript 43%
PHP 35%
CSS 12%
Updated 6 days ago
Go
42%
AGPL 3.0

listmonk

Blogging · Marketing

23,600

High-performance, self-hosted newsletter and mailing list manager packaged as a single binary with built-in analytics, transactional messaging, and multi-channel delivery.

View details
83
Repo Health
74
Technical
67
Dependency
Built with
Go 42%
Vue 24%
JavaScript 19%
Updated 1 weeks ago
TypeScript
88%
MIT

medusa

Ecommerce

36,494

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
93
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 88%
JavaScript 12%
Updated 1 weeks ago
JavaScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,265

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
JavaScript 26%
TypeScript 25%
HTML 19%
Updated 6 days ago
TypeScript
38%
AGPL 3.0

OpenObserve

Analytics · Devops · Monitoring

22,161

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.

View details
90
Repo Health
9
Technical
71
Dependency
Built with
TypeScript 38%
Rust 30%
Vue 18%
Updated 5 days ago
Clojure
72%
MPL 2.0

Penpot

Design Tools

60,454

Open-source design platform with GPU-accelerated canvas, native design tokens, and MCP-powered AI workflows for teams that ship fast.

View details
91
Repo Health
83
Technical
73
Dependency
Built with
Clojure 72%
Updated 6 days ago
TypeScript
100%
AGPL 3.0

RSSHub

Automation · Social Media

46,339

Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.

View details
94
Repo Health
82
Technical
72
Dependency
Built with
TypeScript 100%
Updated 6 days ago
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

44,862

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
69
Dependency
Built with
Python 57%
TypeScript 41%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers