Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 12,113 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.