Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 23, 2024 via pnpm

terser 5.23.0

JavaScript parser, mangler/compressor and beautifier toolkit for ES6+
Package summary
Share
0
issues
3
licenses
10
MIT
1
BSD-3-Clause
1
BSD-2-Clause
Package created
12 May 2018
Version published
30 Oct 2023
Maintainers
1
Total deps
12
Direct deps
4
License
BSD-2-Clause

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
10 Packages, Including:
@jridgewell/gen-mapping@0.3.5
@jridgewell/resolve-uri@3.1.2
@jridgewell/set-array@1.2.1
@jridgewell/source-map@0.3.6
@jridgewell/sourcemap-codec@1.4.15
@jridgewell/trace-mapping@0.3.25
acorn@8.11.3
buffer-from@1.1.2
commander@2.20.3
source-map-support@0.5.21

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
source-map@0.6.1

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
terser@5.23.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of terser 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@jridgewell/source-map0.3.6173.21 kBMIT
prod
acorn8.11.3122.89 kBMIT
prod
commander2.20.318.26 kBMIT
prod
source-map-support0.5.2126.03 kBMIT
prod

Visualizations

Frequently Asked Questions

What does terser do?

Terser is a JavaScript parser, mangler, compressor, and beautifier toolkit targeting ECMAScript 6 and beyond. It works to reduce the size of your JavaScript files by removing redundant or irrelevant data without affecting its functioning. This process is known as compacting or minifying. Terser mangles and compresses your files to remove spaces, indentation, newlines, and comments. In addition, it shortens the names of your variables and parameters to single-letters. Terser is essentially a fork of uglify-es that retains API and CLI compatibility with uglify-es and uglify-js@3.

How do you use terser?

You can use Terser via the command line or programmatically in your application.

To install it for command-line usage, you should run the following command:

npm install terser -g

For programmatic usage within your application, the recommended installation command is:

npm install terser

In your JavaScript code, you can then import Terser and use the minify function to reduce your code size. For instance:

const { minify } = require("terser");

async function run() {
 let code = "function add(first, second) { return first + second; }";
 let result = await minify(code);
 console.log(result.code);  // minified output
}

run();

Please note that the minify function is asynchronous and must be awaited or chained with .then() and .catch().

Where are the terser docs?

The Terser documentation can be found in the README file on its GitHub repository at https://github.com/terser/terser. The available options and API for using Terser are outlined and explained in detail in the README. A link to each section detailing how to use the various options and configurations available in Terser can be found in the Table of Contents.