Skip to content

Releases: onigoetz/resquoosh

1.1.0

13 Sep 21:49
Compare
Choose a tag to compare
  • Replace jest-worker with the smaller tinypool
  • Make the module compatible with ESM while keeping CJS compatibility

Full Changelog: 1.0.1...1.1.0

1.0.1

12 Sep 20:55
Compare
Choose a tag to compare
  • Automatically shutdown worker when unused
  • Cleanup some types and don't re-run codec detection when already done

Full Changelog: 1.0.0...1.0.1

1.0.0

12 Sep 06:19
Compare
Choose a tag to compare

Initial release

import fs from "fs/promises";
import { optimizeImage, getImageSize } from "@onigoetz/resquoosh";

const file = await fs.readFile("file.jpg");

const size = await getImageSize(file);
console.log(size); // { width: 400, height: 400 }

const optimized = await optimizeImage(file);
// returns an optimized buffer

Supports webp, png, avig and jpeg