Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
github.com/wilsonzlin/minify-js
Extremely fast JavaScript minifier, written in Rust.
Comparison with esbuild, run on common libraries.
new
, this
, arguments
, and prototype
aren't used.Precompiled binaries are available for Linux, macOS, and Windows.
Linux x64 | macOS x64 | Windows x64
Use the --help
argument for more details.
minify-js --output /path/to/output.min.js /path/to/src.js
Add the dependency:
[dependencies]
minify-js = "0.5.6"
Call the method:
use minify_js::{Session, TopLevelMode, minify};
let mut code: &[u8] = b"const main = () => { let my_first_variable = 1; };";
let session = Session::new();
let mut out = Vec::new();
minify(&session, TopLevelMode::Global, code, &mut out).unwrap();
assert_eq!(out.as_slice(), b"const main=()=>{let a=1}");
Install the dependency:
npm i @minify-js/node
Call the method:
import {minify} from "@minify-js/node";
const src = Buffer.from("let x = 1;", "utf-8");
const min = minify(src);
import { "a-b" as "c-d" } from "x"
.x === null || x === undefined
with x == null
, where x
is side-effect free.typeof x === "undefined"
with x === undefined
.void x
with x, undefined
.return undefined
with return
.const
with let
.let
and const
.if (...) return a; else if (...) return b; else return c
=> return (...) ? a : (...) ? b : c
.typeof
and instanceof
with functions.FAQs
Unknown package
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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.