You can prettyprint JSON easily by providing parameters to JSON.stringify().
Many people use this kind of call to prettyprint JSON output. It's still valid JSON, it just contains indentation and newlines.
Copy JSON.stringify(myObject, null, 2);
Answer from O. Jones on Stack OverflowBeautifier
beautifier.io
Online JavaScript beautifier
Sublime Text 2: JsFormat, a javascript formatting plugin for this nice editor by Davis Clark, vim: sourcebeautify.vim, a plugin by michalliu (requires node.js, V8, SpiderMonkey or cscript js engine),
GitHub
github.com › beautifier › js-beautify
JS Beautifier
The beautified result is sent to stdout unless otherwise configured. ... To use js-beautify as a node library (after install locally), import and call the appropriate beautifier method for JavaScript (JS), CSS, or HTML. All three method signatures are beautify(code, options).
Author beautifier
EasyRetro
easyretro.io › tools › js-beautifier
JS Beautifier (Simple and Easy) | EasyRetro
You may also want to check out our HTML Beautifier and CSS Beautifier tools. JavaScript has grown far beyond the point of being merely used for simple web dynamics. JavaScript is the programming language of choice for many of the world's most complex systems. Companies like Facebook and Instagram, Netflix, and games like Angry Birds and Bejeweled all use JavaScript to build their software. It can also be used for server-side development with Node and even for Machine Learning using the TensorFlow.js ...
Top answer 1 of 3
20
You can prettyprint JSON easily by providing parameters to JSON.stringify().
Many people use this kind of call to prettyprint JSON output. It's still valid JSON, it just contains indentation and newlines.
Copy JSON.stringify(myObject, null, 2);
2 of 3
1
you can use the tool esformatter.
edit by @jck: here is JS snippet that works using fs:
Copyvar esformatter = require('esformatter');
var fs = require('fs');
var filename = "./myFile.json";
var codeStr = fs.readFileSync(filename).toString();
var formattedCode = esformatter.format(codeStr);
fs.writeFile(filename, formattedCode);
FreeFormatter
freeformatter.com › javascript-beautifier.html
Free Online Javascript Beautifier / Formatter - FreeFormatter.com
This free online tool lets you beautify/format your JavaScript code with no side effects.
Debian Manpages
manpages.debian.org › trixie › node-js-beautify › js-beautify.1.en.html
js-beautify(1) — node-js-beautify — Debian trixie — Debian Manpages
August 16, 2025 - jsbeautifier · node-js-beautify · Scroll to navigation · js-beautify - beautify, unpack or deobfuscate JavaScript · js-beautify.js@1.15.4 · -f, --file · Input file(s) (Pass '-' for stdin) -r, --replace · Write output in-place, replacing input · -o, --outfile ·
npm
npmjs.com › search
jsbeautifier - npm search
An up-to-date version of js-beautify for Assemble's helpers. helper · helper prettify · prettify · beautify · code formatter · code formatting · formatter · formatting · beautifier · prettifier · code-quality · psyrendust• 1.4.0 • 12 years ago • 5 dependentspublished version 1.4.0, 12 years ago5 dependents · 16,500 · beautifier.io for node ·
Ariya
ariya.io › 2010 › 09 › offline-command-line-beautifier-for-javascript-code
offline, command-line beautifier for JavaScript code · ariya.io
September 20, 2010 - Note that this is just a convenient mirror as Einar’s js-beautify repository already includes this Qt Script driver. With the rise of server-side JavaScript and desktop-esque JavaScript tools, I hope Qt Script will become more popular. It is sadly still “underrated” right now. ChakraCore on Linux · On-the-fly JavaScript Syntax Node Inspection ·
npm
npmjs.com › package › js-beautify
js-beautify - npm
February 27, 2025 - beautifier.io for node. Latest version: 1.15.4, last published: a year ago. Start using js-beautify in your project by running `npm i js-beautify`. There are 3131 other projects in the npm registry using js-beautify.
» npm install js-beautify
Published Feb 27, 2025
Version 1.15.4
Author Einar Lielmanis
Repository https://github.com/beautifier/js-beautify
Homepage https://beautifier.io/
js-beautify
js-beautify.com
js-beautify.com
Beautify your javascript code using the popular tool called js beautifier, javascript beautifier, javascript editor, javascript formatter
SourceForge
sourceforge.net › projects › js-beautifier.mirror
JS Beautifier download | SourceForge.net
February 10, 2025 - 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 library and a node package as well.
GitHub
github.com › czottmann › js-beautify-node
czottmann/js-beautify-node
A fork of github.com/einars/js-beautify to make it fit into my node.js setup while removing all the things I don't need (YMMV). ... The original JS Beautifier is written by Einar Lielmanis.
Starred by 20 users
Forked by 6 users
Languages JavaScript
SmallDev
smalldev.tools › javascript-formatter-online
Online Javascript formatter, javascript beautifier - SmallDev.tools
Click Format JS button and it will format the javascript code and show in output. Javascript Beautifier/formatter is an online Tool to easily beautify your Javascript code.
GitHub
github.com › fshost › node-beautify
GitHub - fshost/node-beautify: An asset beautifier for node.js
Node-Beautify is a node.js module that can be easily required and used to beautify assets from within a Node.js script. It is not meant to be a command-line tool, there are plenty of existing tools for that. The purpose of Node-Beautify is for javascript based build scripts or the like that want to be able to 'require' a beautifier module.
Starred by 12 users
Forked by 4 users
Languages JavaScript
Codota
codota.com › home page › code › javascript › js-beautify
js-beautify JavaScript and Node.js code examples | Tabnine
createRequest(props) { debug('Skill Component: createRequest') const request = Object.assign({}, requests[props.requestType]) if ('intent' === props.requestType) { request.request.intent.name = '' request.request.intent.slots = {} if (props.intentName) { request.request.intent.name = props.intentName let slotLookUp = 'default' if (window.INTERACTION_MODEL) { slotLookUp = props.intentName } if (props.slotsByIntent.get(slotLookUp) && props.slotsByIntent.get(slotLookUp).size >= 1) { props.slotsByIntent.get(slotLookUp).forEach((slot) => { request.request.intent.slots[slot.name] = { name: slot.name, value: slot.value } }) } } } return beautify(JSON.stringify(request)) }
Package Control
packagecontrol.io › packages › HTML-CSS-JS Prettify
HTML-CSS-JS Prettify - Packages - Package Control
This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript, JSON, React and Vue code. It uses a set of nice beautifier scripts made by Einar Lielmanis. The formatters are written in JavaScript, so you'll need something (node.js) to interpret JavaScript code outside ...
Npm
npm.io › search › keyword:beautify
Beautify | npm.io
beautifier.io for node · beautifybeautifiercode-quality1.15.4 • Published 11 months ago · Some tweaks for beautifying HTML with js-beautify according to my preferences. beautifyformatformatterhtmljsjs-beautifyprettifypretty2.0.0 • Published 9 years ago ·