A simple library to convert image files to a specific format in a project and or fix anywhere they are referenced in your project files : )
npm i -g reduse
reduse <path/to/web/project/directory> [-f : format ] [--fixImports]
reduse <path/to/web/project/directory> -f <format> - Converts all images in given directory to specified format and outputs them in same location
- Converts all images in given directory to specified format, outputs them to same location. Images of the following formats are accepted and can be converted to another:
- avif
- dz
- fits
- gif
- heif
- input
- jpeg
- jpg
- jp2
- jxl
- magick
- openslide
- png
- ppm
- raw
- svg
- tiff
- tif
- v
- webp
reduse <path/to/web/project/directory> -f <format> --fixImports
- Converts all images in given directory to specified format, outputs them to same location, then replaces any references in the following files:
- .html
- .css
- .scss
- .js
- .jsx
- .ts
- .tsx