JS-BEAUTIFY(1)

πŸ“¦
version 2.0.3 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– JS-BEAUTIFY(1) πŸ’–

okay bestie, sit down, we're learning js-beautify β€” it's the manual page, it's in the User Commands section, and it's about to fix your crusty unreadable JavaScript. no cap.


✨ NAME ✨

js-beautify β€” beautify, unpack or deobfuscate JavaScript πŸ¦‹


✨ SYNOPSIS ✨

jsbeautifier.py [options] <infile>

✨ DESCRIPTION ✨

jsbeautifier.py@1.15.1

Javascript beautifier (<https://beautifier.io/>) β€” literally the glow-up your code has been begging for πŸ’…

quick note bestie: <infile> can be "-", which means stdin. yes, the dash. iconic behaviour honestly.


✨ OPTIONS ✨

🌸 Input options

  • -i, --stdin β€” Read input from stdin

πŸŽ€ Output options

  • -s, --indent-size=NUMBER β€” Indentation size. (default 4).
  • -c, --indent-char=CHAR β€” Character to indent with. (default space).
  • -e, --eol=STRING β€” Character(s) to use as line terminators. (default first newline in file, otherwise "\n")
  • -t, --indent-with-tabs β€” Indent with tabs, overrides -s and -c
  • -d, --disable-preserve-newlines β€” Do not preserve existing line breaks.
  • -P, --space-in-paren β€” Add padding spaces within paren, ie. f( a, b )
  • -E, --space-in-empty-paren β€” Add a single space inside empty paren, ie. f( )
  • -j, --jslint-happy β€” More jslint-compatible output
  • -a, --space-after-anon-function β€” Add a space before an anonymous function's parens, ie. function ()
  • --space-after-named-function β€” Add a space before a named function's parens, i.e. function example ()
  • -b, --brace-style=collapse β€” Brace style (collapse, expand, end-expand, none)(,preserve-inline)
  • -k, --keep-array-indentation β€” Keep array indentation.
  • --quiet β€” Suppress info about a file if nothing was changed.
  • -r, --replace β€” Write output in-place, replacing input
  • -o, --outfile=FILE β€” Specify a file to output to (default stdout)
  • -f, --keep-function-indentation β€” Do not re-indent function bodies defined in var lines.
  • -x, --unescape-strings β€” Decode printable chars encoded in \xNN notation.
  • -X, --e4x β€” Pass E4X xml literals through untouched
  • -C, --comma-first β€” Put commas at the beginning of new line instead of end.
  • -m, --max-preserve-newlines=NUMBER β€” Number of line-breaks to be preserved in one chunk (default 10)
  • -O, --operator-position=STRING β€” Set operator position (before-newline, after-newline, preserve-newline)
  • -w, --wrap-line-length β€” Attempt to wrap line when it exceeds this length. NOTE: Line continues until next wrap point is found.
  • -n, --end-with-newline β€” End output with newline
  • --indent-empty-lines β€” Keep indentation on empty lines
  • --templating β€” List of templating languages (auto,none,django,erb,handlebars,php,smarty,angular) ["auto"] β€” auto = none in JavaScript, all in html
  • --editorconfig β€” Enable setting configuration from EditorConfig

πŸ’€ Rarely needed options

ngl these ones are giving "only if you know why you're here" energy πŸ™ˆ

  • --eval-code β€” evaluate code if a JS interpreter is installed. May be useful with some obfuscated script but poses a potential security issue.
⚠️ bestie, read that again: potential security issue. this one actually runs the code. be so careful. 🚨
  • -l, --indent-level=NUMBER β€” Initial indentation level. (default 0).
  • -h, --help, --usage β€” Prints this help statement.
  • -v, --version β€” Show the version

and that's the whole page, periodt πŸ’œ your code is gonna look so good it'll have main character energy ✨

okay so the official ✨receipts✨ on this one: it's <strong>js-beautify 1.15.1</strong>, dated <strong>March 2024</strong>, and yeah β€” that's the version, that's the date, that's the whole vibe. go forth and beautify, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from