id = "js-beautify"
name = "js-beautify"
homepage = "https://github.com/beautifier/js-beautify"
description = "Beautifier for javascript."
icon = "https://raw.githubusercontent.com/beautifier/js-beautify/main/web/icon.svg"
executables = ["js-beautify", "css-beautify", "html-beautify"]
[dotfiles]
paths = ["~/.jsbeautifyrc"]
exclude = []
secret = []
side_effect = false
[commands]
format = 1
label = "Beautify code"
description = "Reformat JavaScript, CSS or HTML with js-beautify. Only the common indentation and wrapping options are offered; run css-beautify or html-beautify for the other languages."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "readme"
kind = "help"
url = "https://github.com/beautifier/js-beautify/blob/main/README.md"
revision = "2026-10-27"
evidence = """
-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"] Select beautifier type
-q, --quiet Suppress logging to stdout
-s, --indent-size Indentation size [4]
-t, --indent-with-tabs Indent with tabs, overrides -s and -c
-n, --end-with-newline End output with newline
-p, --preserve-newlines Preserve line-breaks (--no-preserve-newlines disables)
-b, --brace-style [collapse|expand|end-expand|none][,preserve-inline] [collapse,preserve-inline]
-w, --wrap-line-length Wrap lines that exceed N characters [0]
"""
[[commands.field]]
id = "file"
label = "Input file"
description = "Reads standard input when empty and no file is given."
type = "path"
path = { kind = "file", role = "input" }
option = ["--file", "-f"]
sources = ["readme"]
[[commands.field]]
id = "outfile"
label = "Output file"
description = "Defaults to standard output."
type = "path"
path = { kind = "file", role = "output" }
option = ["--outfile", "-o"]
sources = ["readme"]
[[commands.field]]
id = "replace"
label = "Replace input file in place"
type = "boolean"
option = ["--replace", "-r"]
effect = "overwrite"
sources = ["readme"]
[[commands.field]]
id = "type"
label = "Beautifier type"
type = "enum"
option = ["--type"]
choices = [{ value = "js", label = "JavaScript" }, { value = "css", label = "CSS" }, { value = "html", label = "HTML" }]
sources = ["readme"]
[[commands.field]]
id = "indent_size"
label = "Indent size"
type = "integer"
option = ["--indent-size", "-s"]
sources = ["readme"]
[[commands.field]]
id = "indent_with_tabs"
label = "Indent with tabs"
type = "boolean"
option = ["--indent-with-tabs", "-t"]
sources = ["readme"]
[[commands.field]]
id = "end_with_newline"
label = "End output with newline"
type = "boolean"
option = ["--end-with-newline", "-n"]
sources = ["readme"]
[[commands.field]]
id = "wrap_line_length"
label = "Wrap line length"
description = "0 disables wrapping."
type = "integer"
option = ["--wrap-line-length", "-w"]
sources = ["readme"]
[[commands.field]]
id = "config"
label = "Config file"
type = "path"
path = { kind = "file", role = "input" }
option = ["--config"]
sources = ["readme"]
[[commands.field]]
id = "quiet"
label = "Quiet"
type = "boolean"
option = ["--quiet", "-q"]
sources = ["readme"]
[[commands.task]]
id = "print"
label = "Print formatted output"
fields = ["file", "indent_size"]
required = ["file"]
[[commands.task]]
id = "in_place"
label = "Format file in place"
fields = ["file", "replace", "indent_size"]
required = ["file", "replace"]
set = { replace = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["file", "outfile", "replace", "type", "indent_size", "indent_with_tabs", "end_with_newline"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["wrap_line_length", "config", "quiet"]