TERSER(1)

πŸ’– TERSER(1) πŸ’–

okay bestie, welcome to the Unix manual page for terser, section 1 (User Commands) β€” like, the main character of JS build tools. she parses JavaScript, she mangles it, she compresses it, she beautifies it. a whole toolkit. no cap. πŸŽ€


✨ NAME ✨

terser β€” JavaScript parser and mangler/compressor and beautifier toolkit

it's giving "does everything" energy and honestly? she does. πŸ’…


🌸 SYNOPSIS 🌸

terser [options] [files...]

πŸ’œ OPTIONS πŸ’œ

so here's the full menu, and yes we're going through every single one, because every flag matters and I would never do you dirty like that. 🫢

  • -V, --version β€” prints out the version number. that's it. that's the whole job. ⭐
  • -p, --parse <options> β€” you're telling terser what the parser should do. parser options go here. πŸ”
  • -c, --compress [options] β€” turn the compressor ON, and also drop in your compressor options while you're at it. πŸ—œοΈ
  • -m, --mangle [options] β€” mangle those names, or specify exactly how you want the mangler to behave. πŸ’€
  • --mangle-props [options] β€” same vibe but for properties this time. mangles properties / lets you specify mangler options for them. πŸ”₯
  • -f, --format [options] β€” format options. she's gonna make it pretty (or not, that's your call). ✨
  • -b, --beautify [options] β€” literally just an alias for --format. same girl, different name. πŸ‘‘
  • -o, --output <file> β€” picks the output file. and if you don't say anything? it goes to STDOUT (that's the default, periodt). 🌈
  • --comments [filter] β€” preserves copyright comments in the output. the legal girlies stay, bestie. πŸŽ€
  • --config-file <file> β€” reads your minify() options straight out of a JSON file. hands-free. πŸ¦‹
  • -d, --define <expr>[=value] β€” global definitions. you know, for when something needs to be defined globally. πŸ“
  • --ecma <version> β€” tells her which ECMAScript release you're on. the options are: 5, 2015, 2016 or 2017... and the "..." is doing a lot of work there, iykyk. ⭐
  • -e, --enclose [arg[,...][:value[,...]]] β€” embeds the whole output inside one big function, with arguments and values you can configure yourself. cozy. 🧚
  • --ie8 β€” support for non-standard Internet Explorer 8. yes, really. nostalgia hours. 😭
  • --keep-classnames β€” do NOT mangle class names, do NOT drop them. leave them alone!! 🌸
  • --keep-fnames β€” do NOT mangle/drop function names. useful for code relying on Function.prototype.name. very specific, very valid. πŸ’œ
  • --module β€” says the input is an ES6 module. πŸŽ€
  • --name-cache <file> β€” the file that holds your mangled name mappings. πŸ’–
  • --rename β€” forces symbol expansion. do it. no thoughts. ✨
  • --no-rename β€” disables symbol expansion. the opposite of the last one, bestie, pick a lane. πŸ™ˆ
  • --safari10 β€” support for non-standard Safari 10. sister to the IE8 situation. πŸ¦‹
  • --source-map [options] β€” enables source maps, or lets you specify your source map options. πŸ”₯
  • --timings β€” displays operations run time on STDERR. numbers!! on stderr!! πŸ‘‘
  • --toplevel β€” compress and/or mangle variables that live in the toplevel scope. the top. the penthouse. 🌈
  • --wrap <name> β€” embeds everything as a function, with ???exports??? corresponding to ???name??? globally. that's the vibe, that's what she does. πŸ’…
  • -h, --help β€” displays help for the command. when in doubt, ask for help. self-care fr fr. 🫢

ok so lowkey the important thing: run her with no output file and she'll just yell everything into STDOUT, and --timings gossips to STDERR instead. keep those apart or your pipes will be a mess. πŸ’€

and that's the whole page, bestie!! you read every single option, every single one, and I'm so proud of you. πŸ’–

this masterpiece of a manual is for terser 5.50.0, dated August 2026 β€” so yeah, she's fresh, she's current, she's THEE JavaScript mangler/compressor/beautifier. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from