{"_id":"compressorjs","_rev":"3013885","name":"compressorjs","description":"JavaScript image compressor.","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"time":{"modified":"2023-09-19T07:53:30.000Z","created":"2018-10-15T13:06:24.702Z","1.2.1":"2023-02-28T14:11:59.951Z","1.2.0":"2023-02-25T12:10:35.192Z","1.1.1":"2021-10-05T02:39:12.356Z","1.1.0":"2021-10-01T06:44:14.836Z","1.0.7":"2020-11-28T07:20:35.905Z","1.0.6":"2019-11-23T05:01:02.649Z","1.0.5":"2019-01-23T11:09:22.023Z","1.0.4":"2019-01-19T08:02:45.141Z","1.0.3":"2018-12-18T15:00:15.623Z","1.0.2":"2018-12-10T13:35:54.874Z","1.0.1":"2018-10-24T13:02:35.907Z","1.0.0":"2018-10-15T13:06:24.702Z"},"users":{},"author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"versions":{"1.2.1":{"name":"compressorjs","version":"1.2.1","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clean":"del-cli dist","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint docs/**/*.css --fix","lint:js":"eslint src test *.js --fix","prepare":"husky install","release":"npm run clean && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js","test:coverage":"cat coverage/lcov.info | codecov"},"dependencies":{"blueimp-canvas-to-blob":"^3.29.0","is-blob":"^2.1.0"},"devDependencies":{"@babel/core":"^7.21.0","@babel/plugin-transform-object-assign":"^7.18.6","@babel/preset-env":"^7.20.2","@commitlint/cli":"^17.4.4","@commitlint/config-conventional":"^17.4.4","@rollup/plugin-babel":"^5.3.1","@rollup/plugin-commonjs":"^21.1.0","@rollup/plugin-node-resolve":"^13.3.0","@rollup/plugin-replace":"^3.1.0","babel-plugin-istanbul":"^6.1.1","chai":"^4.3.7","change-case":"^4.1.2","codecov":"^3.8.3","create-banner":"^2.0.0","cross-env":"^7.0.3","del-cli":"^5.0.0","eslint":"^8.35.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.27.5","husky":"^8.0.3","karma":"^6.4.1","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.1","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.8","lint-staged":"^13.1.2","mocha":"^10.2.0","puppeteer":"^19.7.2","rollup":"^2.79.1","stylelint":"^15.2.0","stylelint-config-standard":"^30.0.1","stylelint-order":"^6.0.2","uglify-js":"^3.17.4"},"gitHead":"079669433076fc2dd034be82e42be4225e3fdeb6","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.2.1","_nodeVersion":"18.2.0","_npmVersion":"9.4.1","dist":{"shasum":"4dee18ef5032f8166bd0a3258f045eda2cd07671","size":38883,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.2.1.tgz"},"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.2.1_1677593519674_0.36760310683934727"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-02-28T14:11:59.951Z","publish_time":1677593519951,"_cnpm_publish_time":1677593519951},"1.2.0":{"name":"compressorjs","version":"1.2.0","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clean":"del-cli dist","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint docs/**/*.css --fix","lint:js":"eslint src test *.js --fix","prepare":"husky install","release":"npm run clean && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js","test:coverage":"cat coverage/lcov.info | codecov"},"dependencies":{"blueimp-canvas-to-blob":"^3.29.0","is-blob":"^2.1.0"},"devDependencies":{"@babel/core":"^7.21.0","@babel/plugin-transform-object-assign":"^7.18.6","@babel/preset-env":"^7.20.2","@commitlint/cli":"^17.4.4","@commitlint/config-conventional":"^17.4.4","@rollup/plugin-babel":"^5.3.1","@rollup/plugin-commonjs":"^21.1.0","@rollup/plugin-node-resolve":"^13.3.0","@rollup/plugin-replace":"^3.1.0","babel-plugin-istanbul":"^6.1.1","chai":"^4.3.7","change-case":"^4.1.2","codecov":"^3.8.3","create-banner":"^2.0.0","cross-env":"^7.0.3","del-cli":"^5.0.0","eslint":"^8.34.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.27.5","husky":"^8.0.3","karma":"^6.4.1","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.1","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.8","lint-staged":"^13.1.2","mocha":"^10.2.0","puppeteer":"^19.7.2","rollup":"^2.79.1","stylelint":"^15.2.0","stylelint-config-standard":"^30.0.1","stylelint-order":"^6.0.2","uglify-js":"^3.17.4"},"gitHead":"616ccc861eeaaf159c1ba54ad78d79299d6d313f","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.2.0","_nodeVersion":"18.2.0","_npmVersion":"9.4.1","dist":{"shasum":"2993d625623f777d960dd5f8b96fda71637b1690","size":23738,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.2.0.tgz"},"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.2.0_1677327035058_0.11272564645689709"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-02-25T12:10:35.192Z","publish_time":1677327035192,"_cnpm_publish_time":1677327035192},"1.1.1":{"name":"compressorjs","version":"1.1.1","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clean":"del-cli dist","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","prepare":"husky install","release":"npm run clean && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js","test:coverage":"cat coverage/lcov.info | codecov"},"dependencies":{"blueimp-canvas-to-blob":"^3.29.0","is-blob":"^2.1.0"},"devDependencies":{"@babel/core":"^7.15.5","@babel/plugin-transform-object-assign":"^7.14.5","@babel/preset-env":"^7.15.6","@commitlint/cli":"^13.2.0","@commitlint/config-conventional":"^13.2.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^21.0.0","@rollup/plugin-node-resolve":"^13.0.5","@rollup/plugin-replace":"^3.0.0","babel-plugin-istanbul":"^6.0.0","chai":"^4.3.4","change-case":"^4.1.2","codecov":"^3.8.3","create-banner":"^2.0.0","cross-env":"^7.0.3","del-cli":"^4.0.1","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","husky":"^7.0.2","karma":"^6.3.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.7","lint-staged":"^11.2.0","mocha":"^9.1.2","puppeteer":"^10.4.0","rollup":"^2.58.0","stylelint":"^13.13.1","stylelint-config-standard":"^22.0.0","stylelint-order":"^4.1.0","uglify-js":"^3.14.2"},"gitHead":"617061be7b448cb3d5d5fa9a0026f70320bd61b4","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.1.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"shasum":"54c147cf37fb38828b08c48646d0258d52faf050","size":24927,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.1.1.tgz"},"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.1.1_1633401552165_0.4549184580321499"},"_hasShrinkwrap":false,"publish_time":1633401552356,"_cnpm_publish_time":1633401552356,"_cnpmcore_publish_time":"2021-12-16T17:23:51.482Z"},"1.1.0":{"name":"compressorjs","version":"1.1.0","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clean":"del-cli dist","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","prepare":"husky install","release":"npm run clean && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js","test:coverage":"cat coverage/lcov.info | codecov"},"dependencies":{"blueimp-canvas-to-blob":"^3.29.0","is-blob":"^2.1.0"},"devDependencies":{"@babel/core":"^7.15.5","@babel/plugin-transform-object-assign":"^7.14.5","@babel/preset-env":"^7.15.6","@commitlint/cli":"^13.2.0","@commitlint/config-conventional":"^13.2.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.5","@rollup/plugin-replace":"^3.0.0","babel-plugin-istanbul":"^6.0.0","chai":"^4.3.4","change-case":"^4.1.2","codecov":"^3.8.3","create-banner":"^2.0.0","cross-env":"^7.0.3","del-cli":"^4.0.1","eslint":"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.24.2","husky":"^7.0.2","karma":"^6.3.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.7","lint-staged":"^11.1.2","mocha":"^9.1.2","puppeteer":"^10.4.0","rollup":"^2.57.0","stylelint":"^13.13.1","stylelint-config-standard":"^22.0.0","stylelint-order":"^4.1.0","uglify-js":"^3.14.2"},"gitHead":"d1bdbf2c1c97e6d927deb03496b466b3a67a745b","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.1.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"shasum":"cde5ee6b49f8199fd211435100c79f45a5640b35","size":67412,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.1.0.tgz"},"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.1.0_1633070654672_0.428028175637879"},"_hasShrinkwrap":false,"publish_time":1633070654836,"_cnpm_publish_time":1633070654836,"_cnpmcore_publish_time":"2021-12-16T17:23:51.767Z"},"1.0.7":{"name":"compressorjs","version":"1.0.7","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.28.0","is-blob":"^2.1.0"},"devDependencies":{"@babel/core":"^7.12.9","@babel/plugin-transform-object-assign":"^7.12.1","@babel/preset-env":"^7.12.7","@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@rollup/plugin-babel":"^5.2.1","@rollup/plugin-commonjs":"^16.0.0","@rollup/plugin-node-resolve":"^10.0.0","@rollup/plugin-replace":"^2.3.4","babel-plugin-istanbul":"^6.0.0","chai":"^4.2.0","change-case":"^4.1.1","codecov":"^3.8.1","create-banner":"^1.0.0","cross-env":"^7.0.2","del-cli":"^3.0.1","eslint":"^7.14.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.22.1","husky":"^4.3.0","karma":"^5.2.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.5","lint-staged":"^10.5.2","mocha":"^8.2.1","puppeteer":"^5.5.0","rollup":"^2.33.3","stylelint":"^13.8.0","stylelint-config-standard":"^20.0.0","stylelint-order":"^4.1.0","uglify-js":"^3.12.0"},"browserslist":["last 2 versions","> 1%","not ie <= 9"],"commitlint":{"extends":["@commitlint/config-conventional"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"{src,test}/**/*.js|*.conf*.js":["eslint --fix","git add"],"{src,docs}/**/*.{css,scss,html}":["stylelint --fix","git add"]},"gitHead":"3b9a283be18adef9af674e54d869f7cc791914c8","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.7","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"shasum":"67cd0b3b9ac97540515b22b334dc32eb92b730b1","size":21310,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.7.tgz"},"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.7_1606548035746_0.908935679010741"},"_hasShrinkwrap":false,"publish_time":1606548035905,"_cnpm_publish_time":1606548035905,"_cnpmcore_publish_time":"2021-12-16T17:23:52.126Z"},"1.0.6":{"name":"compressorjs","version":"1.0.6","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","browser":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com/"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.16.0","is-blob":"^2.0.1"},"devDependencies":{"@babel/core":"^7.7.4","@babel/plugin-transform-object-assign":"^7.7.4","@babel/preset-env":"^7.7.4","@commitlint/cli":"^8.2.0","@commitlint/config-conventional":"^8.2.0","babel-plugin-istanbul":"^5.2.0","chai":"^4.2.0","change-case":"^3.1.0","codecov":"^3.6.1","create-banner":"^1.0.0","cross-env":"^6.0.3","del-cli":"^3.0.0","eslint":"^6.7.0","eslint-config-airbnb-base":"^14.0.0","eslint-plugin-import":"^2.18.2","husky":"^3.1.0","karma":"^4.4.1","karma-chai":"^0.1.0","karma-chrome-launcher":"^3.1.0","karma-coverage-istanbul-reporter":"^2.1.1","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^7.0.2","lint-staged":"^9.4.3","mocha":"^6.2.2","puppeteer":"^2.0.0","rollup":"^1.27.4","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-postprocess":"^1.0.2","stylelint":"^12.0.0","stylelint-config-standard":"^19.0.0","stylelint-order":"^3.1.1","uglify-js":"^3.6.9"},"browserslist":["last 2 versions","> 1%","not ie <= 9"],"commitlint":{"extends":["@commitlint/config-conventional"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"{src,test}/**/*.js|*.conf*.js":["eslint --fix","git add"],"{src,docs}*.{css,scss,html}":["stylelint --fix","git add"]},"gitHead":"5c873ddf9c9d68ad088c474cd9a367e2488d9d11","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.6","_nodeVersion":"10.9.0","_npmVersion":"6.13.1","dist":{"shasum":"75c55e2c3d797afeaa3084bd0cbf03e8374e4b6d","size":57838,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.6.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.6_1574485262390_0.4176713313613245"},"_hasShrinkwrap":false,"publish_time":1574485262649,"_cnpm_publish_time":1574485262649,"_cnpmcore_publish_time":"2021-12-16T17:23:52.381Z"},"1.0.5":{"name":"compressorjs","version":"1.0.5","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^2.0.1"},"devDependencies":{"@babel/core":"^7.2.2","@babel/plugin-transform-object-assign":"^7.2.0","@babel/preset-env":"^7.3.1","@commitlint/cli":"^7.3.2","@commitlint/config-conventional":"^7.3.1","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.1.0","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.12.1","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.15.0","husky":"^1.3.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.1.2","lint-staged":"^8.1.0","mocha":"^5.2.0","puppeteer":"^1.11.0","rollup":"^0.68.2","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^4.0.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","stylelint":"^9.10.1","stylelint-config-standard":"^18.2.0","stylelint-order":"^2.0.0","uglify-js":"^3.4.9"},"browserslist":["last 2 versions","> 1%","not ie <= 9"],"commitlint":{"extends":["@commitlint/config-conventional"]},"husky":{"hooks":{"pre-commit":"lint-staged","commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"lint-staged":{"linters":{"*.js":["eslint --fix","git add"],"*.{css,html}":["stylelint --fix","git add"]},"ignore":["{dist,docs}/**/*.js"]},"gitHead":"eee1943bccf249ebe37a523cba3e3e531422494f","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.5","_nodeVersion":"10.9.0","_npmVersion":"6.6.0","dist":{"shasum":"b02735a802177447a7a14d07d63cfff61c7580dd","size":20588,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.5.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.5_1548241761929_0.4297971768163553"},"_hasShrinkwrap":false,"publish_time":1548241762023,"_cnpm_publish_time":1548241762023,"_cnpmcore_publish_time":"2021-12-16T17:23:52.613Z"},"1.0.4":{"name":"compressorjs","version":"1.0.4","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^2.0.1"},"devDependencies":{"@babel/core":"^7.2.2","@babel/plugin-transform-object-assign":"^7.2.0","@babel/preset-env":"^7.2.3","@commitlint/cli":"^7.3.2","@commitlint/config-conventional":"^7.3.1","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.1.0","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.12.1","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","husky":"^1.3.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.1.2","lint-staged":"^8.1.0","mocha":"^5.2.0","puppeteer":"^1.11.0","rollup":"^0.68.2","rollup-plugin-babel":"^4.3.1","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^4.0.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","stylelint":"^9.10.0","stylelint-config-standard":"^18.2.0","stylelint-order":"^2.0.0","uglify-js":"^3.4.9"},"gitHead":"d1e29e1f8571167b7a56581eaff5b717b159ffc3","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.4","_nodeVersion":"10.9.0","_npmVersion":"6.6.0","dist":{"shasum":"350829171bb6ff8e32254b145ea6c30d4c67aba7","size":20326,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.4.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.4_1547884965008_0.6693373940261671"},"_hasShrinkwrap":false,"publish_time":1547884965141,"_cnpm_publish_time":1547884965141,"_cnpmcore_publish_time":"2021-12-16T17:23:52.836Z"},"1.0.3":{"name":"compressorjs","version":"1.0.3","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^2.0.1"},"devDependencies":{"@babel/core":"^7.2.2","@babel/plugin-transform-object-assign":"^7.2.0","@babel/preset-env":"^7.2.0","@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.0.2","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.10.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","husky":"^1.2.1","karma":"^3.1.4","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.1.1","lint-staged":"^8.1.0","mocha":"^5.2.0","puppeteer":"^1.11.0","rollup":"^0.68.0","rollup-plugin-babel":"^4.1.0","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^4.0.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","stylelint":"^9.9.0","stylelint-config-standard":"^18.2.0","stylelint-order":"^2.0.0","uglify-js":"^3.4.9"},"gitHead":"2d3a78c91221fbbeda8075e32524c1d2cb53a8bd","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.3","_npmVersion":"6.5.0","_nodeVersion":"10.9.0","_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"dist":{"shasum":"cb671fccf39d799bb3de6e8bfd71b175beeaeb9c","size":20038,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.3.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.3_1545145215333_0.16053674638207327"},"_hasShrinkwrap":false,"publish_time":1545145215623,"_cnpm_publish_time":1545145215623,"_cnpmcore_publish_time":"2021-12-16T17:23:53.159Z"},"1.0.2":{"name":"compressorjs","version":"1.0.2","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"npm run lint:js && npm run lint:css","lint:css":"stylelint {docs,examples}/**/*.{css,html} --fix","lint:js":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^2.0.1"},"devDependencies":{"@babel/core":"^7.2.0","@babel/plugin-transform-object-assign":"^7.2.0","@babel/preset-env":"^7.2.0","@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.0.2","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.10.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","husky":"^1.2.0","karma":"^3.1.3","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.1.1","lint-staged":"^8.1.0","mocha":"^5.2.0","puppeteer":"^1.11.0","rollup":"^0.67.4","rollup-plugin-babel":"^4.0.3","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^4.0.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","stylelint":"^9.9.0","stylelint-config-standard":"^18.2.0","stylelint-order":"^2.0.0","uglify-js":"^3.4.9"},"gitHead":"f949d3b07500df0c805d63843c711acf4f4c9811","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"dist":{"shasum":"89fb304445aa85b57926db3c6961d82036ceb3bf","size":19999,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.2.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.2_1544448954706_0.900410883313318"},"_hasShrinkwrap":false,"publish_time":1544448954874,"_cnpm_publish_time":1544448954874,"_cnpmcore_publish_time":"2021-12-16T17:23:53.363Z"},"1.0.1":{"name":"compressorjs","version":"1.0.1","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","commitmsg":"npm run lint && commitlint -e","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^1.0.0"},"devDependencies":{"@babel/core":"^7.1.2","@babel/plugin-transform-object-assign":"^7.0.0","@babel/preset-env":"^7.1.0","@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.0.2","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.7.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","husky":"^1.1.2","karma":"^3.1.1","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.1.0","mocha":"^5.2.0","puppeteer":"^1.9.0","rollup":"^0.66.6","rollup-plugin-babel":"^4.0.3","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","uglify-js":"^3.4.9"},"gitHead":"5a7a0f43f607342f80802208f78e14bf42839074","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"dist":{"shasum":"ebdbb00ac159b8f5f970a3b60a25bd8209490d6c","size":19853,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.1.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.1_1540386155794_0.6963526673129115"},"_hasShrinkwrap":false,"publish_time":1540386155907,"_cnpm_publish_time":1540386155907,"_cnpmcore_publish_time":"2021-12-16T17:23:53.596Z"},"1.0.0":{"name":"compressorjs","version":"1.0.0","description":"JavaScript image compressor.","main":"dist/compressor.common.js","module":"dist/compressor.esm.js","unpkg":"dist/compressor.js","types":"types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/compressorjs.git"},"homepage":"https://fengyuanchen.github.io/compressorjs","license":"MIT","author":{"name":"Chen Fengyuan","url":"https://chenfengyuan.com"},"keywords":["image","compress","compressor","compressor.js","image-compressor","lossy-compression","javascript","front-end","web"],"scripts":{"build":"rollup -c","clear":"del-cli dist","codecov":"cat coverage/lcov.info | codecov","commitmsg":"npm run lint && commitlint -e","compress":"uglifyjs dist/compressor.js -o dist/compressor.min.js -c -m --comments /^!/","dev":"rollup -c -m -w","lint":"eslint src test *.js --fix","release":"npm run clear && npm run lint && npm run build && npm run compress && npm test","start":"npm run dev","test":"cross-env NODE_ENV=test karma start test/karma.conf.js"},"dependencies":{"blueimp-canvas-to-blob":"^3.14.0","is-blob":"^1.0.0"},"devDependencies":{"@babel/core":"^7.1.2","@babel/plugin-transform-object-assign":"^7.0.0","@babel/preset-env":"^7.1.0","@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","babel-plugin-istanbul":"^5.1.0","chai":"^4.2.0","change-case":"^3.0.2","codecov":"^3.1.0","create-banner":"^1.0.0","cross-env":"^5.2.0","del-cli":"^1.1.0","eslint":"^5.7.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.14.0","husky":"^1.1.2","karma":"^3.0.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage-istanbul-reporter":"^2.0.4","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-rollup-preprocessor":"^6.0.1","mocha":"^5.2.0","puppeteer":"^1.9.0","rollup":"^0.66.6","rollup-plugin-babel":"^4.0.3","rollup-plugin-commonjs":"^9.2.0","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-postprocess":"^1.0.2","rollup-watch":"^4.3.1","uglify-js":"^3.4.9"},"gitHead":"54a384d2bf3bdc5cbc4c5ab706dc3d378b1859e1","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"_id":"compressorjs@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"},"dist":{"shasum":"41630687b555e5f0b0c90ec617bee2423d11ce7a","size":19687,"noattachment":false,"key":"/compressorjs/-/compressorjs-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/compressorjs/download/compressorjs-1.0.0.tgz"},"maintainers":[{"name":"chenfengyuan","email":"chenfengyuan@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/compressorjs_1.0.0_1539608784527_0.9513529880273961"},"_hasShrinkwrap":false,"publish_time":1539608784702,"_cnpm_publish_time":1539608784702,"_cnpmcore_publish_time":"2021-12-16T17:23:53.797Z"}},"readme":"# Compressor.js\n\n[![Coverage Status](https://img.shields.io/codecov/c/github/fengyuanchen/compressorjs.svg)](https://codecov.io/gh/fengyuanchen/compressorjs) [![Downloads](https://img.shields.io/npm/dm/compressorjs.svg)](https://www.npmjs.com/package/compressorjs) [![Version](https://img.shields.io/npm/v/compressorjs.svg)](https://www.npmjs.com/package/compressorjs) [![Gzip Size](https://img.shields.io/bundlephobia/minzip/compressorjs.svg)](https://unpkg.com/compressorjs/dist/compressor.common.js)\n\n> JavaScript image compressor. Uses the Browser's native [canvas.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) API to do the compression work, which means it is **lossy compression**, **asynchronous**, and has **different compression effects in different browsers**. Generally use this to precompress a image on the client side before uploading it.\n\n- [Website](https://fengyuanchen.github.io/compressorjs)\n\n## Table of contents\n\n- [Main](#main)\n- [Getting started](#getting-started)\n- [Options](#options)\n- [Methods](#methods)\n- [No conflict](#no-conflict)\n- [Browser support](#browser-support)\n- [Contributing](#contributing)\n- [Versioning](#versioning)\n- [License](#license)\n\n## Main\n\n```text\ndist/\n├── compressor.js        (UMD)\n├── compressor.min.js    (UMD, compressed)\n├── compressor.common.js (CommonJS, default)\n└── compressor.esm.js    (ES Module)\n```\n\n## Getting started\n\n### Install\n\n```shell\nnpm install compressorjs\n```\n\n### Usage\n\n#### Syntax\n\n```js\nnew Compressor(file[, options])\n```\n\n**file**\n\n- Type: [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) or [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)\n\nThe target image file for compressing.\n\n**options**\n\n- Type: `Object`\n- Optional\n\nThe options for compressing. Check out the available [options](#options).\n\n#### Example\n\n```html\n<input type=\"file\" id=\"file\" accept=\"image/*\">\n```\n\n```js\nimport axios from 'axios';\nimport Compressor from 'compressorjs';\n\ndocument.getElementById('file').addEventListener('change', (e) => {\n  const file = e.target.files[0];\n\n  if (!file) {\n    return;\n  }\n\n  new Compressor(file, {\n    quality: 0.6,\n\n    // The compression process is asynchronous,\n    // which means you have to access the `result` in the `success` hook function.\n    success(result) {\n      const formData = new FormData();\n\n      // The third parameter is required for server\n      formData.append('file', result, result.name);\n\n      // Send the compressed image file to server with XMLHttpRequest.\n      axios.post('/path/to/upload', formData).then(() => {\n        console.log('Upload success');\n      });\n    },\n    error(err) {\n      console.log(err.message);\n    },\n  });\n\n});\n```\n\n[⬆ back to top](#table-of-contents)\n\n## Options\n\nYou may set compressor options with `new Compressor(file, options)`.\nIf you want to change the global default options, You may use `Compressor.setDefaults(options)`.\n\n### strict\n\n- Type: `boolean`\n- Default: `true`\n\nIndicates whether to output the original image instead of the compressed one when the size of the compressed image is greater than the original one's, except the following cases:\n\n- The `retainExif` option is set to `true`.\n- The `mimeType` option is set and its value is different from the mime type of the image.\n- The `width` option is set and its value is greater than the natural width of the image.\n- The `height` option is set and its value is greater than the natural height of the image.\n- The `minWidth` option is set and its value is greater than the natural width of the image.\n- The `minHeight` option is set and its value is greater than the natural height of the image.\n- The `maxWidth` option is set and its value is less than the natural width of the image.\n- The `maxHeight` option is set and its value is less than the natural height of the image.\n\n### checkOrientation\n\n- Type: `boolean`\n- Default: `true`\n\nIndicates whether to read the image's Exif Orientation value (JPEG image only), and then rotate or flip the image automatically with the value.\n\n**Notes:**\n\n- Don't trust this all the time as some JPEG images have incorrect (not standard) Orientation values.\n- If the size of the target image is too large (e.g., greater than 10 MB), you should disable this option to avoid an out-of-memory crash.\n- The image's Exif information will be removed after compressed, so if you need the Exif information, you may need to upload the original image as well.\n\n### retainExif\n\n- Type: `boolean`\n- Default: `false`\n\nIndicates whether to retain the image's Exif information after compressed.\n\n### maxWidth\n\n- Type: `number`\n- Default: `Infinity`\n\nThe max-width of the output image. The value should be greater than `0`.\n\n> Avoid getting a blank output image, you might need to set the `maxWidth` and `maxHeight` options to limited numbers, because of [the size limits of a canvas element](https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element), recommend to use `4096` or lesser.\n\n### maxHeight\n\n- Type: `number`\n- Default: `Infinity`\n\nThe max height of the output image. The value should be greater than `0`.\n\n### minWidth\n\n- Type: `number`\n- Default: `0`\n\nThe min-width of the output image. The value should be greater than `0` and should not be greater than the `maxWidth`.\n\n### minHeight\n\n- Type: `number`\n- Default: `0`\n\nThe min-height of the output image. The value should be greater than `0` and should not be greater than the `maxHeight`.\n\n### width\n\n- Type: `number`\n- Default: `undefined`\n\nThe width of the output image. If not specified, the natural width of the original image will be used, or if the `height` option is set, the width will be computed automatically by the natural aspect ratio.\n\n### height\n\n- Type: `number`\n- Default: `undefined`\n\nThe height of the output image. If not specified, the natural height of the original image will be used, or if the `width` option is set, the height will be computed automatically by the natural aspect ratio.\n\n### resize\n\n- Type: `string`\n- Default: `\"none\"`\n- Options: `\"none\"`, `\"contain\"`, and `\"cover\"`.\n\nSets how the size of the image should be resized to the container specified by the `width` and `height` options.\n\n**Note:** This option only available when both the `width` and `height` options are specified.\n\n### quality\n\n- Type: `number`\n- Default: `0.8`\n\nThe quality of the output image. It must be a number between `0` and `1`. If this argument is anything else, the default values `0.92` and `0.80` are used for `image/jpeg` and `image/webp` respectively. Other arguments are ignored. Be careful to use `1` as it may make the size of the output image become larger.\n\n**Note:** This option only available for `image/jpeg` and `image/webp` images.\n\n> Check out [canvas.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) for more detail.\n\n**Examples**:\n\n| Quality | Input size | Output size | Compression ratio | Description |\n| --- | --- | --- | --- | --- |\n| 0 | 2.12 MB | 114.61 KB | 94.72% | - |\n| 0.2 | 2.12 MB | 349.57 KB | 83.90% | - |\n| 0.4 | 2.12 MB | 517.10 KB | 76.18% | - |\n| 0.6 | 2.12 MB | 694.99 KB | 67.99% | Recommend |\n| 0.8 | 2.12 MB | 1.14 MB | 46.41% | Recommend |\n| 1 | 2.12 MB | 2.12 MB | 0% | Not recommend |\n| NaN | 2.12 MB | 2.01 MB | 5.02% | - |\n\n### mimeType\n\n- Type: `string`\n- Default: `'auto'`\n\nThe mime type of the output image. By default, the original mime type of the source image file will be used.\n\n### convertTypes\n\n- Type: `Array` or `string` (multiple types should be separated by commas)\n- Default: `['image/png']`\n- Examples:\n  - `['image/png', 'image/webp']`\n  - `'image/png,image/webp'`\n\nFiles whose file type is included in this list, and whose file size exceeds the `convertSize` value will be converted to JPEGs.\n\n### convertSize\n\n- Type: `number`\n- Default: `5000000` (5 MB)\n\nFiles whose file type is included in the `convertTypes` list, and whose file size exceeds this value will be converted to JPEGs. To disable this, just set the value to `Infinity`.\n\n**Examples**:\n\n| convertSize | Input size (type) | Output size (type) | Compression ratio |\n| --- | --- | --- | --- |\n| 5 MB | 1.87 MB (PNG) | 1.87 MB (PNG) | 0% |\n| 5 MB | 5.66 MB (PNG) | 450.24 KB (JPEG) | 92.23% |\n| 5 MB | 9.74 MB (PNG) | 883.89 KB (JPEG) | 91.14% |\n\n### beforeDraw(context, canvas)\n\n- Type: `Function`\n- Default: `null`\n- Parameters:\n  - `context`: The 2d rendering context of the canvas.\n  - `canvas`: The canvas for compression.\n\nThe hook function to execute before drawing the image into the canvas for compression.\n\n```js\nnew Compressor(file, {\n  beforeDraw(context, canvas) {\n    context.fillStyle = '#fff';\n    context.fillRect(0, 0, canvas.width, canvas.height);\n    context.filter = 'grayscale(100%)';\n  },\n});\n```\n\n### drew(context, canvas)\n\n- Type: `Function`\n- Default: `null`\n- Parameters:\n  - `context`: The 2d rendering context of the canvas.\n  - `canvas`: The canvas for compression.\n\nThe hook function to execute after drawing the image into the canvas for compression.\n\n```js\nnew Compressor(file, {\n  drew(context, canvas) {\n    context.fillStyle = '#fff';\n    context.font = '2rem serif';\n    context.fillText('watermark', 20, canvas.height - 20);\n  },\n});\n```\n\n### success(result)\n\n- Type: `Function`\n- Default: `null`\n- Parameters:\n  - `result`: The compressed image (a `File` (**read only**) or `Blob` object).\n\nThe hook function to execute when successful to compress the image.\n\n### error(err)\n\n- Type: `Function`\n- Default: `null`\n- Parameters:\n  - `err`: The compression error (an `Error` object).\n\nThe hook function executes when fails to compress the image.\n\n[⬆ back to top](#table-of-contents)\n\n## Methods\n\n### abort()\n\nAbort the compression process.\n\n```js\nconst compressor = new Compressor(file);\n\n// Do something...\ncompressor.abort();\n```\n\n## No conflict\n\nIf you have to use another compressor with the same namespace, just call the `Compressor.noConflict` static method to revert to it.\n\n```html\n<script src=\"other-compressor.js\"></script>\n<script src=\"compressor.js\"></script>\n<script>\n  Compressor.noConflict();\n  // Code that uses other `Compressor` can follow here.\n</script>\n```\n\n## Browser support\n\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Opera (latest)\n- Edge (latest)\n- Internet Explorer 10+\n\n## Contributing\n\nPlease read through our [contributing guidelines](.github/CONTRIBUTING.md).\n\n## Versioning\n\nMaintained under the [Semantic Versioning guidelines](https://semver.org/).\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com/)\n\n[⬆ back to top](#table-of-contents)\n","_attachments":{},"homepage":"https://fengyuanchen.github.io/compressorjs","bugs":{"url":"https://github.com/fengyuanchen/compressorjs/issues"},"license":"MIT"}