https://github.com/vdistortion/to-webp-json
Image conversion to WebP and more
https://github.com/vdistortion/to-webp-json
cli-tool image-conversion nodejs typescript
Last synced: 8 months ago
JSON representation
Image conversion to WebP and more
- Host: GitHub
- URL: https://github.com/vdistortion/to-webp-json
- Owner: vdistortion
- License: gpl-3.0
- Created: 2023-04-05T16:30:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-08T15:18:22.000Z (about 1 year ago)
- Last Synced: 2025-06-10T15:45:31.794Z (about 1 year ago)
- Topics: cli-tool, image-conversion, nodejs, typescript
- Language: TypeScript
- Homepage: https://zvalentin.ru/to-webp-json/
- Size: 1.15 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# to-webp-json
[](https://www.npmjs.com/package/to-webp-json)
[](https://github.com/vdistortion/to-webp-json)
[](https://stackblitz.com/github/vdistortion/to-webp-json)
[](https://vdistortion.github.io/to-webp-json/)
A CLI tool that converts images to the desired format, 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.
## 📖 Usage
Create an `img-src` folder
```shell
mkdir img-src
```
Place images inside `img-src`
```shell
npx to-webp-json@latest
```
## 💻 Command-line options
| 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`, or keep original (`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 |
| concurrency | number | Maximum number of concurrent image processing tasks | 5 |
## ✨ Examples
```shell
npx to-webp-json json=static-images format=original
```
```shell
npx to-webp-json src=sources height=2000
```
Run with no arguments (interactive mode)
```shell
npx to-webp-json
```
## 🌍 Translations
The documentation is available in several languages, but it can always be improved.
If you notice mistakes or want to add a new language, contributions are very welcome!