About this project

js-beautify is a popular open-source code formatter that reformats and re-indents JavaScript, CSS, and HTML code. It can also handle bookmarklets, unpack scripts packed by Dean Edward's packer, and partly deobfuscate scripts processed by the javascript-obfuscator npm package. The project is available in multiple forms: as a Node.js package (js-beautify on npm), a Python package (jsbeautifier on PyPI), a web library hosted on CDNs like cdnjs, and a command-line tool. The web version is accessible at beautifier.io. Key features include extensive configuration options for indentation size and character, brace style, spacing within parentheses, line wrapping, newline preservation, and more. It supports EditorConfig integration, configuration files (.jsbeautifyrc), and environment variables for settings. The tool also supports source-level directives (ignore and preserve) that allow developers to control formatting behavior within their source files. The JavaScript implementation supports all three languages (JS, CSS, HTML), while the Python version only handles JavaScript. Both implementations share similar option names and behavior. The project is MIT licensed and actively maintained, though it is seeking additional contributors.