{"library":"compressorjs","type":"library","category":null,"description":"Compressor.js is a client-side JavaScript image compression library that leverages the browser's native `HTMLCanvasElement.toBlob()` method for its core functionality. It performs lossy, asynchronous compression, meaning results can vary slightly across different web browsers and privacy settings. Primarily designed for pre-compressing images on the client before upload, it provides a straightforward API for handling `File` or `Blob` objects. The current stable version is 1.3.0, and the project appears actively maintained with a steady cadence of minor updates addressing bug fixes and introducing new options. Its key differentiator is its reliance on native browser APIs, simplifying its footprint but also making its compression effects browser-dependent. It ships with TypeScript types.","language":"javascript","status":"active","version":"1.3.0","tags":["javascript","image","compress","compressor","compressor.js","image-compressor","lossy-compression","front-end","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install compressorjs","imports":["import Compressor from 'compressorjs';","const Compressor = require('compressorjs/dist/compressor.common.js');","import Compressor from 'compressorjs'; Compressor.setDefaults({ quality: 0.8 });"]},{"cmd":"yarn add compressorjs","imports":[]},{"cmd":"pnpm add compressorjs","imports":[]}],"homepage":"https://fengyuanchen.github.io/compressorjs","github":"https://github.com/fengyuanchen/compressorjs","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/compressorjs","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/compressorjs/compatibility"}}