Check out this post on using JSBeautify with Textmate. It has some good instructions on how to install it on your system. On Mac OS X, I used:

cd /tmp
git clone https://github.com/einars/js-beautify.git
cd js-beautify/python
python setup.py install

Then you can simply use js-beautify /path/to/filename.js to have it run.

Answer from cwd on Stack Overflow
🌐
GitHub
github.com › beautifier › js-beautify
GitHub - beautifier/js-beautify: Beautifier for javascript · GitHub
Unlike the JavaScript version, the Python version can only reformat JavaScript. It does not work against HTML or CSS files, but you can install css-beautify for CSS: ... You can beautify JavaScript using JS Beautifier in your web browser, or on the command-line using Node.js or Python.
Author   beautifier
🌐
Beautifier
beautifier.io
Online JavaScript beautifier
Chrome, in case the built-in CSS and javascript formatting isn't enough for you: — Quick source viewer by Tomi Mickelsson (github, blog), — Javascript and CSS Code beautifier by c7sky, — jsbeautify-for-chrome by Tom Rix (github), — Pretty Beautiful JavaScript by Will McSweeney — Stackoverflow Code Beautify by Making Odd Edit Studios (github). Firefox: Javascript deminifier by Ben Murphy, to be used together with the firebug (github), ... Sublime Text 2/3: CodeFormatter, a python plugin by Avtandil Kikabidze, supports HTML, CSS, JS and a bunch of other languages,
🌐
PyPI
pypi.org › project › jsbeautifier
jsbeautifier · PyPI
JavaScript unobfuscator and beautifier.
      » pip install jsbeautifier
    
Published   Feb 27, 2025
Version   1.15.4
🌐
GitHub
gist.github.com › m4ll0k › 033c81a36e1e3cf06e8eb9d42e881a1e
Javascript Beautifier with Python · GitHub
Javascript Beautifier with Python . GitHub Gist: instantly share code, notes, and snippets.
🌐
Snyk
snyk.io › advisor › jsbeautifier › jsbeautifier code examples
Top 5 jsbeautifier Code Examples | Snyk
#!/usr/bin/env python # -*- coding: utf-8 -*- import io import os import copy import jsbeautifier options = jsbeautifier.default_options() options.wrap_line_length = 80 data = '' data_min = '' def beautifier_test_underscore(): jsbeautifier.beautify(data, options) def beautifier_test_underscore_min(): jsbeautifier.beautify(data_min, options) def beautifier_test_github_min(): jsbeautifier.beautify(github_min, options) beautify-web / js-beautify / python / jsbeautifier / unpackers / packer.py View on Github ·
🌐
UNPKG
unpkg.com › browse › js-beautify@0.4.2 › README.md
js-beautify/README.md
# JS Beautifier ...or, more ...p://javascriptobfuscator.com/). ## Usage To beautify from the command-line you can use the provided Python script/library or [npm](http://npmjs.org/) package....
🌐
ProgramCreek
programcreek.com › python › example › 108358 › jsbeautifier.beautify
Python Examples of jsbeautifier.beautify
def read_testcase(self, testcase_path): self.testcase_path = testcase_path if self.should_skip(): return LOG.info("Attempting to beautify %s", testcase_path) self.lithium.strategy = self.strategy_type() # pylint: disable=not-callable self.lithium.testcase = self.testcase_type() # pylint: disable=not-callable # Beautify testcase with open(testcase_path) as testcase_fp: self.original_testcase = testcase_fp.read() beautified_testcase = jsbeautifier.beautify(self.original_testcase) # All try/catch pairs will be expanded on their own lines # Collapse these pairs when only a single instruction is contained # within regex = r"(\s*try {)\n\s*(.*)\n\s*(}\s*catch.*)" beautified_testcase = re.sub(regex, r"\1 \2 \3", beautified_testcase) with open(testcase_path, 'w') as testcase_fp: testcase_fp.write(beautified_testcase) self.lithium.testcase.readTestcase(testcase_path) Example #8 ·
🌐
GitHub
github.com › beautifier › js-beautify › blob › main › python › jsbeautifier › javascript › beautifier.py
js-beautify/python/jsbeautifier/javascript/beautifier.py at main · beautifier/js-beautify
class Beautifier: def __init__(self, opts=None): import jsbeautifier.javascript.acorn as acorn · · self.acorn = acorn · self._options = BeautifierOptions(opts) · self._blank_state() · def _blank_state(self, js_source_text=None): if js_source_text is None: js_source_text = "" ·
Author   beautifier
Find elsewhere
🌐
Kali Linux Tools
en.kali.tools
JS Beautifier - Penetration Testing Tools
sudo pacman -R python-jsbeautifier sudo pacman -S npm sudo npm -g install js-beautify js-beautify -h · Another installation option is installation from AUR. This is the recommended way to install JS Beautifier because it gives you the full version of the program with automatic updates when new versions are released.
🌐
SourceForge
sourceforge.net › projects › js-beautifier.mirror
JS Beautifier download | SourceForge.net
SourceForge is not affiliated with JS Beautifier. ... This little beautifier will reformat and re-indent bookmarklets, ugly JavaScript, unpack scripts packed by Dean Edward’s popular packer, as well as partly deobfuscate scripts processed by the npm package javascript-obfuscator. All of the source code is completely free and open, available on GitHub under MIT licence, and we have a command-line version, python ...
🌐
npm
npmjs.com › package › js-beautify › v › 1.6.1
js-beautify - npm
You can beautify javascript using JS Beautifier in your web browser, or on the command-line using node.js or python.
      » npm install js-beautify
    
Published   Feb 27, 2025
Version   1.6.1
Author   Einar Lielmanis
🌐
Kali Linux Tools
en.kali.tools › all
python-jsbeautifier
Home / Tools / python-jsbeautifier · List of all available tools for penetration testing. Description: JavaScript unobfuscator and beautifier · Category: reversing webapp · Version: 1.15.1 · WebSite: https://github.com/beautify-web/js-beautify · Last Updated: 2024-02-21 ·
🌐
Arch Linux
archlinux.org › packages › extra › any › python-jsbeautifier
Arch Linux - python-jsbeautifier 1.15.4-2 (any)
View the file list for python-jsbeautifier · View the soname list for python-jsbeautifier · Copyright © 2002-2026 Judd Vinet, Aaron Griffin and Levente Polyák. The Arch Linux name and logo are recognized trademarks. Some rights reserved.
🌐
GitHub
github.com › jkmnt › js-beautify-py-html
GitHub - jkmnt/js-beautify-py-html: Beautifier for javascript
Unlike the JavaScript version, the Python version can only reformat JavaScript. It does not work against HTML or CSS files, but you can install css-beautify for CSS: ... You can beautify JavaScript using JS Beautifier in your web browser, or on the command-line using Node.js or Python.
Author   jkmnt
🌐
Bayern
umweltatlas.bayern.de › mapapps › resources › jsregistry › root › js-beautify › latest › README.md
js-beautify/README.md (latest)
These are the command-line flags for both Python and JS scripts: CLI Options: -f, --file Input file(s) (Pass '-' for stdin) -r, --replace Write output in-place, replacing input -o, --outfile Write output to file (default stdout) --config Path to config file --type [js|css|html] ["js"] -q, --quiet Suppress logging to stdout -h, --help Show this help -v, --version Show the version Beautifier Options: -s, --indent-size Indentation size [4] -c, --indent-char Indentation character [" "] -l, --indent-level Initial indentation level [0] -t, --indent-with-tabs Indent with tabs, overrides -s and -c -p, --preserve-newlines Preserve line-breaks (--no-preserve-newlines disables) -m, --max-preserve-newlines Number of line-breaks to be preserved in one chunk [10] -P, --space-in-paren Add padding spaces within paren, ie.
🌐
Snyk
snyk.io › advisor › jsbeautifier › functions › jsbeautifier.default_options
How to use the jsbeautifier.default_options function in jsbeautifier | Snyk
#!/usr/bin/env python # -*- coding: utf-8 -*- import io import os import copy import jsbeautifier options = jsbeautifier.default_options() options.wrap_line_length = 80 data = '' data_min = '' def beautifier_test_underscore(): jsbeautifier.beautify(data, options) def beautifier_test_underscore_min(): jsbeautifier.beautify(data_min, options) def beautifier_test_github_min(): jsbeautifier.beautify(github_min, options) cs50 / style50 / style50 / languages.py View on Github ·
🌐
Snyk
snyk.io › advisor › jsbeautifier › functions › jsbeautifier.beautify_file
How to use the jsbeautifier.beautify_file function in jsbeautifier | Snyk
import jsbeautifier import sys import os import random filename = sys.argv[2]+"-"+str(os.times()[4])+"-"+str(random.randint(1,99999))+".txt" os.system("copy NUL db/"+filename) parser = open(sys.argv[1],"r") body = parser.read().split('\r\n\r\n') with open("db/"+filename,'w') as f: f.write(body[1]) parser.close() res = jsbeautifier.beautify_file("db/"+filename) with open("db/"+filename,'w') as f: f.write(res) print filename
🌐
Packagist
packagist.org › packages › bchecketts › js-beautify
bchecketts/js-beautify - Packagist
These are the command-line flags for both Python and JS scripts: CLI Options: -f, --file Input file(s) (Pass '-' for stdin) -r, --replace Write output in-place, replacing input -o, --outfile Write output to file (default stdout) --config Path to config file --type [js|css|html] ["js"] -q, --quiet Suppress logging to stdout -h, --help Show this help -v, --version Show the version Beautifier Options: -s, --indent-size Indentation size [4] -c, --indent-char Indentation character [" "] -l, --indent-level Initial indentation level [0] -t, --indent-with-tabs Indent with tabs, overrides -s and -c -p, --preserve-newlines Preserve line-breaks (--no-preserve-newlines disables) -m, --max-preserve-newlines Number of line-breaks to be preserved in one chunk [10] -P, --space-in-paren Add padding spaces within paren, ie.
🌐
GitHub
github.com › beautifier › js-beautify › blob › main › python › jsbeautifier › __init__.py
js-beautify/python/jsbeautifier/__init__.py at main · beautifier/js-beautify
# by Liam Newman <bitwiseman@beautifier.io> # Python is not my native language, feel free to push things around. # # Use either from command line (script displays its usage when run · # without any parameters), # # # or, alternatively, use it as a module: # # import jsbeautifier ·
Author   beautifier