Home / npm packages / terser

terser source code

Every file of terser@5.51.2 as published on npm: 41 files, 1.2 MB. Search them by exact text or regex, in milliseconds.

It uses: eval(), new Function(), process.env, the fs module, XMLHttpRequest.

What terser uses

APIIn terser
eval()
runs a string as JavaScript
Yes: 1 file
e.g. CHANGELOG.md
See the lines
new Function()
builds a function from a string, like eval (with or without new)
Yes: 2 files
e.g. lib/compress/index.js
See the lines
child_process
starts other programs
NoWho does
process.env
reads environment variables
Yes: 1 file
e.g. lib/minify.js
See the lines
the fs module
reads and writes files
Yes: 1 file
e.g. bin/terser
See the lines
http / https
makes or serves HTTP requests with Node's own modules
NoWho does
fetch()
makes HTTP requests
NoWho does
XMLHttpRequest
makes HTTP requests the old browser way
Yes: 1 file
e.g. tools/domprops.js
See the lines
crypto
hashes, encrypts or makes random numbers
NoWho does
WebAssembly
loads WebAssembly code
NoWho does
document.cookie
reads or writes browser cookies
NoWho does
install scripts
runs a script when it's installed
NoWho does

Exact matches in the published files, so a mention in a comment counts too: open the lines to check.

Largest files

FileSize
tools/domprops.js202 KB
lib/compress/index.js153 KB
lib/parse.js135 KB
lib/ast.js104 KB
lib/output.js87 KB
lib/mozilla-ast.js68 KB
README.md61 KB
lib/compress/tighten-body.js61 KB
lib/compress/inference.js43 KB
lib/scope.js37 KB
CHANGELOG.md36 KB
lib/compress/reduce-vars.js25 KB
lib/compress/inline.js24 KB
lib/compress/drop-unused.js21 KB
lib/unicode.js19 KB
lib/cli.js18 KB
lib/compress/evaluate.js17 KB
lib/propmangle.js15 KB
lib/compress/native-objects.js15 KB
lib/minify.js15 KB
lib/compress/drop-side-effect-free.js14 KB
lib/compress/common.js12 KB
lib/size.js12 KB
lib/transform.js10 KB
lib/equivalent-to.js9.1 KB
lib/utils/index.js8.5 KB
tools/terser.d.ts6.5 KB
lib/sourcemap.js5.0 KB
lib/compress/global-defs.js3.4 KB
package.json3.3 KB

Questions

How many files are in terser?

Version 5.51.2 of terser publishes 41 files of source, 1.2 MB in all, not counting images, fonts and source maps.

Does terser use eval?

Yes: terser calls eval() in 1 of its files.

Does terser start other programs?

No: terser doesn't use child_process anywhere in its published files.

Does terser run an install script?

No: terser has no preinstall, install or postinstall script in its package.json.

npm packages that use…

Every package we've indexed →

Search your own code like this

The same engine answers over your documents and repositories: exact text and regex, every match counted, from your code or your AI agent.

See StackGrep Engine