Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
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 5 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.