{"_id":"@eggjs/compressible","_rev":"1410018","name":"@eggjs/compressible","description":"Compressible Content-Type / mime checking. Forked for TypeScript and keep mime-db as same version as mime-types","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"akitasummer","email":"644171127@qq.com"}],"time":{"modified":"2026-09-14T02:39:26.000Z","created":"2025-03-12T15:44:31.898Z","3.0.0":"2025-03-12T15:44:31.898Z"},"users":{},"repository":{"url":"git+https://github.com/eggjs/compressible.git","type":"git"},"versions":{"3.0.0":{"name":"@eggjs/compressible","version":"3.0.0","keywords":["compress","gzip","mime","content-type"],"license":"MIT","_id":"@eggjs/compressible@3.0.0","maintainers":[{"name":"gxkl","email":"gxkl203@gmail.com"},{"name":"eggjs-admin","email":"fengmk2+eggjs@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"atian25","email":"atian25@qq.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"wanghx","email":"whxaxes@gmail.com"},{"name":"hyj1991","email":"yeekwanvong@gmail.com"},{"name":"killagu","email":"killa07071201@gmail.com"},{"name":"coolme200","email":"2001-wms@163.com"},{"name":"mansonchor.zzw","email":"mansonchor1987@gmail.com"},{"name":"hubcarl","email":"hubcarl@126.com"},{"name":"gemwuu","email":"gemwuu@gmail.com"},{"name":"akitasummer","email":"644171127@qq.com"}],"contributors":[{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},{"url":"http://jongleberry.com","name":"Jonathan Ong","email":"me@jongleberry.com"},{"url":"https://searchbeam.jit.su","name":"Jeremiah Senkpiel","email":"fishrock123@rocketmail.com"}],"homepage":"https://github.com/eggjs/compressible#readme","bugs":{"url":"https://github.com/eggjs/compressible/issues"},"dist":{"shasum":"1a0b23dc6856a0d638d0ea2dd2b099417a6b8382","tarball":"http://registry-npm.ywwl.com/@eggjs/compressible/download/@eggjs/compressible-3.0.0.tgz","fileCount":11,"integrity":"sha512-Bz/u+0zhmZ/44xdIL1MLfknaDFQpE+bSfJ4OjCb2NnHpg+LVmmNwEpRW4hUi3v2MhaO3sNWD93gBTtJ00q2iIA==","signatures":[{"sig":"MEUCIBy3qn0No009nty074NKCt3qdHJ9cXpo0weYYCiB8uEOAiEAyULuR8lyK46VDH3zbgmXEt2dIqph47FtMKVo9XvTysQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eggjs%2fcompressible@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11674,"size":4110,"noattachment":false,"key":"/@eggjs/compressible/-/@eggjs/compressible-3.0.0.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">= 18.19.0"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"3b40a850e688a324aa54b58427957e02ac88a0b3","scripts":{"ci":"egg-bin cov","lint":"eslint --cache src test --ext .ts","test":"egg-bin test","clean":"rimraf dist","preci":"npm run clean &&  npm run lint","postci":"npm run prepublishOnly && npm run clean","pretest":"npm run clean && npm run lint -- --fix","prepublishOnly":"tshy && tshy-after && attw --pack"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git+https://github.com/eggjs/compressible.git","type":"git"},"_npmVersion":"10.8.2","description":"Compressible Content-Type / mime checking. Forked for TypeScript and keep mime-db as same version as mime-types","directories":{},"_nodeVersion":"20.18.3","dependencies":{"mime-db":"1.52.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"3","eslint":"8","rimraf":"6","@eggjs/bin":"7","tshy-after":"1","typescript":"5","@types/node":"22","@types/mocha":"10","@types/mime-db":"^1.43.5","@eggjs/tsconfig":"2","eslint-config-egg":"14","@arethetypeswrong/cli":"^0.17.4"},"_npmOperationalInternal":{"tmp":"tmp/compressible_3.0.0_1741794271673_0.19907434313551398","host":"s3://npm-registry-packages-npm-production"},"publish_time":1741794271898,"_cnpm_publish_time":1741794271898}},"readme":"# @eggjs/compressible\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/eggjs/compressible/actions/workflows/nodejs.yml/badge.svg)](https://github.com/eggjs/compressible/actions/workflows/nodejs.yml)\n[![Test coverage][codecov-image]][codecov-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/@eggjs/compressible.svg?style=flat)](https://nodejs.org/en/download/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/eggjs/compressible)\n\n[npm-image]: https://img.shields.io/npm/v/@eggjs/compressible.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/@eggjs/compressible\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/compressible.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs/compressible?branch=master\n[snyk-image]: https://snyk.io/test/npm/@eggjs/compressible/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/@eggjs/compressible\n[download-image]: https://img.shields.io/npm/dm/@eggjs/compressible.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@eggjs/compressible\n\nCompressible `Content-Type` / `mime` checking.\n\nForked [compressible](https://github.com/jshttp/compressible) for TypeScript and keep mime-db as same version as mime-types.\n\n## Installation\n\n```sh\nnpm install @eggjs/compressible\n```\n\n## API\n\n```ts\nimport { compressible } from '@eggjs/compressible';\n```\n\n### compressible(type)\n\nChecks if the given `Content-Type` is compressible. The `type` argument is expected\nto be a value MIME type or `Content-Type` string, though no validation is performed.\n\nThe MIME is looked up in the [`mime-db`](https://www.npmjs.com/package/mime-db) and\nif there is compressible information in the database entry, that is returned. Otherwise,\nthis module will fallback to `true` for the following types:\n\n* `text/*`\n* `*/*+json`\n* `*/*+text`\n* `*/*+xml`\n\nIf this module is not sure if a type is specifically compressible or specifically\nuncompressible, `undefined` is returned.\n\n```ts\ncompressible('text/html') // => true\ncompressible('image/png') // => false\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=eggjs/compressible)](https://github.com/eggjs/compressible/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","_attachments":{},"homepage":"https://github.com/eggjs/compressible#readme","bugs":{"url":"https://github.com/eggjs/compressible/issues"},"license":"MIT"}