Installations
npm install @putout/minify
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=18
Node Version
22.13.1
NPM Version
10.9.0
Score
85.9
Supply Chain
100
Quality
95.1
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
putoutjs
Download Statistics
Total Downloads
388,895
Last Day
188
Last Week
5,227
Last Month
21,566
Last Year
270,876
GitHub Statistics
MIT License
12 Stars
574 Commits
3 Forks
2 Watchers
1 Branches
3 Contributors
Updated on Feb 17, 2025
Package Meta Information
Latest Version
4.12.2
Package Id
@putout/minify@4.12.2
Unpacked Size
1.28 MB
Size
349.16 kB
File Count
4
NPM Version
10.9.0
Node Version
22.13.1
Published on
Feb 17, 2025
Total Downloads
Cumulative downloads
Total Downloads
388,895
Last Day
8%
188
Compared to previous day
Last Week
-3.9%
5,227
Compared to previous week
Last Month
39.2%
21,566
Compared to previous month
Last Year
129.5%
270,876
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
58
@putout/minify

🐊Putout-based JavaScript minifier.
Install
1npm i @putout/minify
Supported minifier transforms
Here is list of supported 🐊Putout transformations:
- ✅
apply-template-literals
; - ✅
apply-optional-chaining
; - ✅
conditions
; - ✅
convert-to-arrow-function
; - ✅
convert-arguments-to-rest
; - ✅
declare
; - ✅
for-of
; - ✅
logical-expressions
; - ✅
merge-duplicate-functions
; - ✅
merge-duplicate-imports
; - ✅
merge-destructuring-properties
; - ✅
minify
; - ✅
new
; - ✅
regexp
; - ✅
reuse-duplicate-init
; - ✅
remove-empty
; - ✅
remove-nested-blocks
; - ✅
remove-unused-variables
; - ✅
remove-unused-expressions
; - ✅
remove-unreferenced-variables
; - ✅
remove-useless-arguments
; - ✅
remove-useless-else
; - ✅
remove-useless-return
; - ✅
remove-useless-spread
; - ✅
remove-useless-variables
; - ✅
remove-console
; - ✅
remove-debugger
; - ✅
remove-unreachable-code
; - ✅
simplify-ternary
; - ✅
types
;
API
1import {minify} from '@putout/minify'; 2 3minify(` 4 const a = 5; 5 const b = 6; 6 7 fn(a, b); 8`);
// returns
var a=5,b=6;fn(a,b);
Options
You can also pass options to minify
. Here is list of default options:
1({ 2 quotes: `'`, 3 fixCount: 1, // the more fixCount - less output size 4 conditions: false, 5 mangleClassNames: true, 6 mangle: true, 7 mergeVariables: true, 8 removeUnusedVariables: false, 9 removeConsole: false, 10 removeUselessSpread: true, 11 applyTemplateLiterals: true, 12 convertStrictEqualToEqual: false, 13});
And usage example:
1import {minify} from '@putout/minify'; 2 3const source = ` 4 const a = 5; 5 const b = 6; 6`; 7 8minify(source, { 9 removeUnusedVariables: false, 10});
How it's compared to X(your benchmark)?
License
MIT

No vulnerabilities found.

No security vulnerabilities found.