https://github.com/vdistortion/to-webp-json
Convert images to webp
https://github.com/vdistortion/to-webp-json
convert images json library nodejs typescript webp
Last synced: 3 months ago
JSON representation
Convert images to webp
- Host: GitHub
- URL: https://github.com/vdistortion/to-webp-json
- Owner: vdistortion
- License: gpl-3.0
- Created: 2023-04-05T16:30:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-04T18:26:35.000Z (7 months ago)
- Last Synced: 2025-02-23T17:01:40.416Z (3 months ago)
- Topics: convert, images, json, library, nodejs, typescript, webp
- Language: TypeScript
- Homepage: http://zvalentin.ru/to-webp-json/
- Size: 1010 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# to-webp-json
[](https://www.npmjs.com/package/to-webp-json)
[](https://github.com/astrotrain55/to-webp-json)
[](https://github.com/astrotrain55/to-webp-json)
[](https://stackblitz.com/github/vdistortion/to-webp-json)[](https://vdistortion.github.io/to-webp-json/)
### Usage
Create `img-src` folder
```shell
mkdir img-src
```Add images to `img-src`
```shell
npx to-webp-json@latest
```### Command line options
| Param | Type | Description | Default |
| ------ | -------------- | ------------------------------------------- | -------- |
| src | string | Source folder name | img-src |
| dist | string | Result folder name | img-dist |
| format | string | webp, jpg, png, avif, tiff, gif or original | webp |
| json | string \| null | Structure file name | null |
| width | number \| null | Maximum image width in pixels | null |
| height | number \| null | Maximum image height in pixels | null |### Examples
```shell
npx to-webp-json json=static-images format=original
``````shell
npx to-webp-json src=sources height=2000
``````shell
# no arguments interactive mode
npx to-webp-json
```