Socket
Socket
Sign inDemoInstall

@putout/minify

Package Overview
Dependencies
0
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @putout/minify

🐊Putout-based minifier


Version published
Weekly downloads
6.3K
increased by24.35%
Maintainers
1
Created
Weekly downloads
Β 

Readme

Source

@putout/minify NPM versionΒ Coverage Status

🐊Putout-based JavaScript minifier.

Install

npm i @putout/minify

Supported minifier transforms

Here is list of supported 🐊Putout transformations:

API

import {minify} from '@putout/minify';

minify(`
    const a = 5;
    const b = 6;
    
    fn(a, b);
`);
// returns
var a=5,b=6;fn(a,b);

Options

You can also pass options to minify. Here is list of default options:

({
    mangleClassNames: true,
    mangle: true,
    removeUnusedVariables: true,
    removeConsole: false,
    removeUselessSpread: true,
    applyTemplateLiterals: true,
});

And usage example:

import {minify} from '@putout/minify';

const source = `
    const a = 5;
    const b = 6;
`;

minify(source, {
    removeUnusedVariables: true,
});

How it's compared to Terser?

For such code:

  • πŸ”₯ @putout/minify: 473B
  • ❌ terser: 482B

react.js:

  • πŸ”₯ @putout/minify: 16309B
  • ❌ terser: 16346B

License

MIT

Keywords

FAQs

Last updated on 05 May 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc