Skip to main content
Pass an ObfuscatorOptions object as the second argument to obfuscate. Every field is optional.
ObfuscatorOptions

minify

Type: boolean
Default: false
Passes Babel’s minified flag to the generator, removing optional whitespace and line breaks from the returned JavaScript.

verbose

Type: boolean
Default: false
Prints the name and elapsed milliseconds of each executed stage to standard error. It does not change the returned source.

transforms

Type: object
Default: omitted
No configurable transform runs unless its key is true. Transforms with settings also accept an options object. An omitted key or false means that transform does not run. Internal preparation passes are outside this map and always run. The defaults for minify, verbose, stringGeneratorMode, and seed do not cause transforms to run. They control output or supply settings used by transforms that do run. renameIdentifiers and specialsToStrings also accept { stringGeneratorMode }. concealStrings accepts { cache, cover, scope }. pack accepts { escapeStrict, skipGlobals, stringGeneratorMode }. mangleProperties accepts its property options.
Run transforms

Removal

Simplification and inlining

Declarations and functions

Control flow

Expressions

Names and literals

Packing

stringGeneratorMode

Type: 'mangled' | 'hexadecimal' | 'randomized' | 'zeroWidth' | 'number' | readonly StringGeneratorMode[]
Default: 'mangled'
Sets the default style for generated identifiers, labels, property names, and string contents. An array mixes its modes with the seeded random source. An empty array is invalid. See String generator modes.

seed

Type: number
Default: 0
Seeds built-in randomized choices. The same seed and other inputs produce the same output for fixed package and Node.js versions. This random source is not cryptographic.

Configure transforms

Choose individual passes, set a naming style, and configure property mangling.
Last modified on August 26, 2026