TERSER(1)

πŸ“¦ version 4.1.2, in ubuntu jammy

✨ NAME ✨

terser β€” it's a toolkit, bestie πŸ’– that's the whole vibe. A whole lil toolbox for squishing your JavaScript down to its smallest, most efficient self.


πŸŽ€ SYNOPSIS πŸŽ€

uglifyjs [options] [files...]

okay so lowkey the binary is called uglifyjs, not terser, and yes that's iconic of it 🫢 you run it, you hand it some [options], you hand it some [files...], and it does its thing.


πŸ’… OPTIONS πŸ’…

grab a snack, this is the main character section πŸ“

  • -V, --version β€” spits out the version number, that's it, that's the whole job πŸ’«
  • -p, --parse <options> β€” lets you specify your parser options 🧚
  • -c, --compress [options] β€” turns the compressor ON, or lets you specify compressor options if you wanna get specific ✨
  • -m, --mangle [options] β€” mangles names, or lets you specify mangler options πŸ”₯
  • --mangle-props [options] β€” mangles properties, or lets you specify mangler options for that πŸŽ€
  • -b, --beautify [options] β€” beautifies the output, or lets you specify output options πŸ’…
  • -o, --output <file> β€” the output file, and no cap the default is STDOUT 🫢
  • --comments [filter] β€” preserves copyright comments in the output ⭐
  • --config-file <file> β€” reads minify() options straight out of a JSON file πŸ“„
  • -d, --define <expr>[=value] β€” global definitions 🌍
  • --ecma <version> β€” specifies the ECMAScript release: 5, 6, 7 or 8 πŸ‘‘
  • -e, --enclose [arg[,...][:value[,...]]] β€” embeds your output inside one big function, with configurable arguments and values 🧸
  • --ie8 β€” supports non-standard Internet Explorer 8 😭 (yes, really)
  • --keep-classnames β€” do NOT mangle or drop class names, leave them be πŸ™ˆ
  • --keep-fnames β€” do NOT mangle or drop function names. genuinely useful if your code is relying on Function.prototype.name πŸ’œ
  • --module β€” the input is an ES6 module πŸ“¦
  • --name-cache <file> β€” the file that holds your mangled name mappings πŸ—‚οΈ
  • --rename β€” forces symbol expansion πŸ’₯
  • --no-rename β€” disables symbol expansion 🚫
  • --safari10 β€” supports non-standard Safari 10 🌈
  • --source-map [options] β€” enables the source map, or lets you specify source map options πŸ—ΊοΈ
  • --timings β€” displays operations run time on STDERR ⏱️
  • --toplevel β€” compresses and/or mangles variables in the toplevel scope πŸ”
  • --verbose β€” prints diagnostic messages, for when you simply must know everything πŸ‘€
  • --warn β€” prints warning messages ⚠️
  • --wrap <name> β€” embeds everything as a function, with ???exports??? corresponding to ???name??? globally 🎁
  • -h, --help β€” displays help for the command, aka the lil hand-holding moment 🫢

and that's the whole page, you ate that πŸ’…

this was terser version 4.1.2, dated February 2022, from the User Commands corner of the manual πŸ’– periodt. ✨

πŸ“¦ where this page comes from