id = "js-beautify" name = "js-beautify" homepage = "https://github.com/beautifier/js-beautify" description = "Beautifier for javascript." # The js-beautify icon, from the project's own web assets. icon = "https://raw.githubusercontent.com/beautifier/js-beautify/main/web/icon.svg" executables = ["js-beautify", "css-beautify", "html-beautify"] [dotfiles] # README, "Loading settings from environment or JSON file": settings come from # "any jsbeautify_-prefixed environment variables", "a JSON-formatted file # indicated by the --config parameter" and "a .jsbeautifyrc file containing JSON # data at any level of the filesystem above $PWD". # # The home directory is the last rung of that walk, and the CLI names it # explicitly rather than relying on $PWD happening to sit under it — # js/src/cli.js: `var configHome = verifyExists(path.join(getUserHome() || "", # ".jsbeautifyrc"))`, with `getUserHome()` returning `process.env.USERPROFILE || # process.env.HOME || ''`. So ~/.jsbeautifyrc is the user-level default for # every project, and %USERPROFILE%\.jsbeautifyrc on Windows is the same file # under another name for the home directory. # # The per-project .jsbeautifyrc files are not user-level and are not listed. paths = ["~/.jsbeautifyrc"] exclude = [] # Formatting options only — indent size, wrap width, brace style. Nothing here # is a credential. secret = [] # No machine_lines: indentation and brace style are precisely the preferences a # user wants identical on every machine. 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"]