{"_id":"cache-content-type","_rev":"4084741","name":"cache-content-type","description":"Create a full Content-Type header given a MIME type or extension and cache the result","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"time":{"modified":"2025-12-01T22:11:39.000Z","created":"2018-07-11T08:12:48.833Z","2.1.0":"2025-03-11T16:35:47.693Z","2.0.0":"2024-06-08T11:35:34.622Z","1.0.1":"2018-07-18T14:17:03.773Z","1.0.0":"2018-07-11T08:12:48.833Z"},"users":{},"author":{"name":"dead_horse"},"repository":{"type":"git","url":"git+https://github.com/node-modules/cache-content-type.git"},"versions":{"2.1.0":{"name":"cache-content-type","version":"2.1.0","engines":{"node":">= 18.0.0"},"description":"Create a full Content-Type header given a MIME type or extension and cache the result","scripts":{"clean":"tsc --build --clean","pretest":"npm run clean && npm run lint -- --fix","test":"egg-bin test","preci":"npm run clean && npm run lint","ci":"egg-bin cov","postci":"npm run prepublishOnly && npm run clean","lint":"eslint src test","prepublishOnly":"tshy && tshy-after"},"dependencies":{"mime-types":"^2.1.35","ylru":"^2.0.0"},"devDependencies":{"@eggjs/tsconfig":"2","@types/mime-types":"2","@types/mocha":"10","@types/node":"^22","@eggjs/bin":"7","eslint":"8","eslint-config-egg":"14","mm":"4","tshy":"3","tshy-after":"1","typescript":"5"},"repository":{"type":"git","url":"git+https://github.com/node-modules/cache-content-type.git"},"keywords":["mime","content-type","lru"],"author":{"name":"dead_horse"},"license":"MIT","type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","_id":"cache-content-type@2.1.0","gitHead":"b4d59700bf3f0d4aad25db504cb316526fc029fa","bugs":{"url":"https://github.com/node-modules/cache-content-type/issues"},"homepage":"https://github.com/node-modules/cache-content-type#readme","_nodeVersion":"20.18.3","_npmVersion":"10.8.2","dist":{"shasum":"6bfb2b0d0c76a6fe1e5b93a18c2d0ce949bf05ad","size":3328,"noattachment":false,"key":"/cache-content-type/-/cache-content-type-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cache-content-type/download/cache-content-type-2.1.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cache-content-type_2.1.0_1741710947500_0.40461729355739284"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-11T16:35:47.693Z","publish_time":1741710947693,"_source_registry_name":"default","_cnpm_publish_time":1741710947693},"2.0.0":{"name":"cache-content-type","version":"2.0.0","engines":{"node":">= 18.0.0"},"description":"Create a full Content-Type header given a MIME type or extension and cache the result","scripts":{"test":"npm run lint -- --fix && egg-bin test","ci":"npm run lint && egg-bin cov && npm run prepublishOnly","lint":"eslint src test","prepublishOnly":"tshy && tshy-after"},"dependencies":{"mime-types":"^2.1.35","ylru":"^1.4.0"},"devDependencies":{"@eggjs/tsconfig":"^1.3.3","@types/mime-types":"^2.1.4","@types/mocha":"^10.0.1","@types/node":"^20.2.5","egg-bin":"6","eslint":"8","eslint-config-egg":"13","mm":"3","tshy":"^1.15.1","tshy-after":"^1.0.0","typescript":"^5.4.5"},"repository":{"type":"git","url":"git+https://github.com/node-modules/cache-content-type.git"},"keywords":["mime","content-type","lru"],"author":{"name":"dead_horse"},"license":"MIT","type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"source":"./src/index.ts","types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"source":"./src/index.ts","types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","_id":"cache-content-type@2.0.0","gitHead":"3c8626875f9c5d0c43027714cc16c9a7d954bb54","bugs":{"url":"https://github.com/node-modules/cache-content-type/issues"},"homepage":"https://github.com/node-modules/cache-content-type#readme","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"shasum":"178b9d192e2d7008189bfb18feadf27c6d76b1ad","size":2413,"noattachment":false,"key":"/cache-content-type/-/cache-content-type-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cache-content-type/download/cache-content-type-2.0.0.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-content-type_2.0.0_1717846534431_0.5420111216608616"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-08T11:35:34.622Z","publish_time":1717846534622,"_source_registry_name":"default","_cnpm_publish_time":1717846534622},"1.0.1":{"name":"cache-content-type","version":"1.0.1","description":"Create a full Content-Type header given a MIME type or extension and catch the result","main":"index.js","files":["index.js"],"scripts":{"test":"egg-bin test","cov":"egg-bin cov","ci":"eslint . && npm run cov"},"dependencies":{"mime-types":"^2.1.18","ylru":"^1.2.0"},"devDependencies":{"egg-bin":"^4.7.1","egg-ci":"^1.8.0","eslint":"^5.1.0","eslint-config-egg":"^7.0.0","mm":"^2.2.0"},"repository":{"type":"git","url":"git+https://github.com/node-modules/cache-content-type.git"},"keywords":["mime","content-type","lru"],"engines":{"node":">= 6.0.0"},"ci":{"version":"6, 8, 10"},"author":{"name":"dead_horse"},"license":"MIT","gitHead":"8a43ff8b3f800aef8fa366d99e0a2828705a9ffe","bugs":{"url":"https://github.com/node-modules/cache-content-type/issues"},"homepage":"https://github.com/node-modules/cache-content-type#readme","_id":"cache-content-type@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"dist":{"shasum":"035cde2b08ee2129f4a8315ea8f00a00dba1453c","size":1140,"noattachment":false,"key":"/cache-content-type/-/cache-content-type-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cache-content-type/download/cache-content-type-1.0.1.tgz"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-content-type_1.0.1_1531923423675_0.6944377224730394"},"_hasShrinkwrap":false,"publish_time":1531923423773,"_cnpm_publish_time":1531923423773},"1.0.0":{"name":"cache-content-type","version":"1.0.0","description":"Create a full Content-Type header given a MIME type or extension and catch the result","main":"index.js","files":["index.js"],"scripts":{"test":"egg-bin test","cov":"egg-bin cov","ci":"eslint . && npm run cov"},"dependencies":{"mime-types":"^2.1.18","ylru":"^1.2.0"},"devDependencies":{"egg-bin":"^4.7.1","egg-ci":"^1.8.0","eslint":"^5.1.0","eslint-config-egg":"^7.0.0","mm":"^2.2.0"},"repository":{"type":"git","url":"git+https://github.com/node-modules/cache-content-type.git"},"keywords":["mime","content-type","lru"],"engines":{"node":">= 8.0.0"},"ci":{"version":"8, 10"},"author":{"name":"dead_horse"},"license":"MIT","gitHead":"c753a384e4aea6f867938eb1f59121a480b589d3","bugs":{"url":"https://github.com/node-modules/cache-content-type/issues"},"homepage":"https://github.com/node-modules/cache-content-type#readme","_id":"cache-content-type@1.0.0","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"dist":{"shasum":"6ee4210bc51693af0736e8d41416c1eb771c3ffb","size":1054,"noattachment":false,"key":"/cache-content-type/-/cache-content-type-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cache-content-type/download/cache-content-type-1.0.0.tgz"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cache-content-type_1.0.0_1531296768754_0.9174562289955348"},"_hasShrinkwrap":false,"publish_time":1531296768833,"_cnpm_publish_time":1531296768833}},"readme":"# cache-content-type\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/node-modules/cache-content-type/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/cache-content-type/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/cache-content-type.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/node-modules/cache-content-type)\n\n[npm-image]: https://img.shields.io/npm/v/cache-content-type.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/cache-content-type\n[codecov-image]: https://codecov.io/github/node-modules/cache-content-type/coverage.svg?branch=master\n[codecov-url]: https://codecov.io/github/node-modules/cache-content-type?branch=master\n[snyk-image]: https://snyk.io/test/npm/cache-content-type/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/cache-content-type\n[download-image]: https://img.shields.io/npm/dm/cache-content-type.svg?style=flat-square\n[download-url]: https://npmjs.org/package/cache-content-type\n\nThe same as [mime-types](https://github.com/jshttp/mime-types)'s contentType method, but with result cached.\n\n## Install\n\n```bash\nnpm i cache-content-type\n```\n\n## Usage\n\n```ts\nimport { getType } from 'cache-content-type';\n\nconst contentType = getType('html');\nassert.equal(contentType, 'text/html; charset=utf-8');\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=node-modules/cache-content-type)](https://github.com/node-modules/cache-content-type/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","_attachments":{},"homepage":"https://github.com/node-modules/cache-content-type#readme","bugs":{"url":"https://github.com/node-modules/cache-content-type/issues"},"license":"MIT"}