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.
img-optimizer-react
Advanced tools
img-optimizer aims to provide a subset of [next/image](https://nextjs.org/docs/api-reference/next/image) as a framework-independent library, making it possible to integrate with your favorite tools and frameworks. img-optimizer delivers compressed images
img-optimizer aims to provide a subset of next/image as a framework-independent library, making it possible to integrate with your favorite tools and frameworks. img-optimizer delivers compressed images to the browser on demand. It prioritizes the avif format when the browser supports it, falling back to webp.
Integration examples:
Integration guide:
import express from "express";
import { createOptimizer } from "img-optimizer/server";
const app = express();
app.use(express.static("public"));
const optimize = createOptimizer({
domains: ["some.domain.com"]
});
app.get("/img-optimizer", async (req, res, next) => {
const result = await optimize({
url: req.url,
headers: req.headers,
});
const { body, status, headers } = result;
res.status(status).header(headers).send(body);
});
app.listen(3000, () => {
console.log("Listening on http://localhost:3000");
});
Simple JS:
import { createSrcSet } from "img-optimizer";
`
<img srcset="${createSrcSet("/test-8k.jpg")}" />
<img srcset="${createSrcSet("https://some.domain.com/some-image.jpg")}" />
`
With React:
import image from "./test-8k.jpg";
import { Image } from "img-optimizer-react";
export function Page() {
return (
<>
<Image
src={image}
fill
alt=""
style={{
objectFit: "contain",
background: "#cef",
}}
/>
<Image
src="https://some.domain.com/some-image.jpg"
fill
alt=""
style={{
objectFit: "contain",
background: "#cef",
}}
/>
</>
);
}
createOptimizer options:
FAQs
img-optimizer aims to provide a subset of [next/image](https://nextjs.org/docs/api-reference/next/image) as a framework-independent library, making it possible to integrate with your favorite tools and frameworks. img-optimizer delivers compressed images
The npm package img-optimizer-react receives a total of 3 weekly downloads. As such, img-optimizer-react popularity was classified as not popular.
We found that img-optimizer-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.