Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
babel-minify
Advanced tools
Node API and CLI
Use babel-minify
if you don't already use babel (as a preset) or want to run it standalone.
npm install babel-minify --save-dev
const minify = require("babel-minify");
const {code, map} = minify("input code", {
mangle: {
keepClassName: true
}
});
minify input.js --out-file input.min.js --mangle.keepClassName
const minify = require("babel-minify");
minify(input, minifyOptions, overrides)
Refer babel-preset-minify options
babel
: Custom babelminifyPreset
: Custom minify presetinputSourceMap
: Input SourcemapsourceMaps
: [Boolean]comments
: [Function | RegExp | Boolean]minify input.js [options]
For simple options, use --optionName
in CLI
Refer preset's 1-1 options for the list of options
Example:
minify input.js --mangle false
Usage: --optionName.featureName
Example:
minify input.js --mangle.keepClassName --deadcode.keepFnArgs --outFile input.min.js
Refer the corresponding plugins to know the list of options it takes
--out-file path/to/file.min.js
: Output filename. Used only when reading from STDIN / a single input file--out-dir path/to/dir
: Output Directory.FAQs
✂️ An ES6+ aware minifier based on the Babel toolchain (beta)
The npm package babel-minify receives a total of 27,826 weekly downloads. As such, babel-minify popularity was classified as popular.
We found that babel-minify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.