Socket
Socket
Sign inDemoInstall

@types/uglify-js

Package Overview
Dependencies
1
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/uglify-js


Version published
Maintainers
1
Created

Package description

What is @types/uglify-js?

@types/uglify-js provides TypeScript type definitions for the UglifyJS JavaScript minification tool. UglifyJS is used to compress and minify JavaScript files, making them smaller and faster to load.

What are @types/uglify-js's main functionalities?

Minify JavaScript Code

This feature allows you to minify JavaScript code, reducing its size and improving load times. The code sample demonstrates how to use UglifyJS to minify a simple JavaScript function.

const UglifyJS = require('uglify-js');
const code = 'function add(a, b) { return a + b; }';
const result = UglifyJS.minify(code);
console.log(result.code);

Compress JavaScript Code

This feature enables compression of JavaScript code, which can further reduce the size of the output. The code sample shows how to use the compress option to achieve this.

const UglifyJS = require('uglify-js');
const code = 'function add(a, b) { return a + b; }';
const result = UglifyJS.minify(code, { compress: true });
console.log(result.code);

Mangle Variable Names

This feature allows you to mangle variable names, making the code harder to read and reverse-engineer. The code sample demonstrates how to use the mangle option to obfuscate variable names.

const UglifyJS = require('uglify-js');
const code = 'function add(a, b) { return a + b; }';
const result = UglifyJS.minify(code, { mangle: true });
console.log(result.code);

Other packages similar to @types/uglify-js

Readme

Source

Installation

npm install --save @types/uglify-js

Summary

This package contains type definitions for UglifyJS (https://github.com/mishoo/UglifyJS2).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uglify-js

Additional Details

  • Last updated: Mon, 15 Oct 2018 17:21:49 GMT
  • Dependencies: source-map
  • Global values: none

Credits

These definitions were written by Alan Agius https://github.com/alan-agius4, Tanguy Krotoff https://github.com/tkrotoff, John Reilly https://github.com/johnnyreilly.

FAQs

Last updated on 15 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc