
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
to-webp-json
Advanced tools
A CLI tool that converts images to the desired format (webp
, jpg
, png
, etc.), generates a structured JSON map of the output files, and optionally resizes them by width and/or height. Useful for static sites, galleries, and automation.
Create an img-src
folder
mkdir img-src
Place images inside img-src
npx to-webp-json@latest
Option | Type | Description | Default |
---|---|---|---|
src | string | Source folder name | img-src |
dist | string | Result folder name | img-dist |
format | string | Output format: webp, jpg, png, avif, tiff, gif or original | webp |
json | string | null | Output JSON filename (or null to skip) | null |
width | number | null | Maximum image width in pixels | null |
height | number | null | Maximum image height in pixels | null |
npx to-webp-json json=static-images format=original
npx to-webp-json src=sources height=2000
Run with no arguments (interactive mode)
npx to-webp-json
[0.3.4] - 2025-05-28
FAQs
Image conversion for static websites
We found that to-webp-json demonstrated a healthy version release cadence and project activity because the last version was released less than 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 Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.