{"_id":"fast-content-type-parse","_rev":"4048325","name":"fast-content-type-parse","description":"Parse HTTP Content-Type header according to RFC 7231","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"time":{"modified":"2025-09-01T06:31:49.000Z","created":"2023-01-06T07:40:08.353Z","3.0.0":"2025-03-08T16:33:03.786Z","2.0.1":"2025-01-03T13:15:21.735Z","2.0.0":"2024-07-13T20:53:21.156Z","1.1.0":"2023-09-21T18:14:59.954Z","1.0.0":"2023-01-09T10:40:53.855Z","0.0.1":"2023-01-06T07:40:08.353Z"},"users":{},"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"versions":{"3.0.0":{"name":"fast-content-type-parse","version":"3.0.0","description":"Parse HTTP Content-Type header according to RFC 7231","main":"index.js","type":"commonjs","types":"./types/index.d.ts","scripts":{"benchmark":"node benchmarks/simple.js && node benchmarks/simple-ows.js && node benchmarks/with-param.js && node benchmarks/with-param-quoted.js","lint":"eslint","lint:fix":"eslint --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"keywords":["content-type","rfc7231"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"contributors":[{"name":"Gürgün Dayıoğlu","email":"hey@gurgun.day","url":"https://heyhey.to/G"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"James Sumners","url":"https://james.sumners.info"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"devDependencies":{"@fastify/pre-commit":"^2.1.0","benchmark":"^2.1.4","busboy":"^1.6.0","c8":"^10.1.3","content-type":"^1.0.4","eslint":"^9.17.0","neostandard":"^0.12.0","tsd":"^0.31.0"},"pre-commit":["lint","test"],"_id":"fast-content-type-parse@3.0.0","gitHead":"bf6861c1a2bad438f9a1f274477096aff04a09fd","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"shasum":"5590b6c807cc598be125e6740a9fde589d2b7afb","size":6363,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-3.0.0.tgz"},"_npmUser":{"name":"fdawgs","email":"frazer.dev@icloud.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-content-type-parse_3.0.0_1741451583605_0.14521008573288618"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-08T16:33:03.786Z","publish_time":1741451583786,"_source_registry_name":"default","_cnpm_publish_time":1741451583786},"2.0.1":{"name":"fast-content-type-parse","version":"2.0.1","description":"Parse HTTP Content-Type header according to RFC 7231","main":"index.js","type":"commonjs","types":"./types/index.d.ts","scripts":{"benchmark":"node benchmarks/simple.js && node benchmarks/simple-ows.js && node benchmarks/with-param.js && node benchmarks/with-param-quoted.js","lint":"eslint","lint:fix":"eslint --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"tap"},"keywords":["content-type","rfc7231"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"contributors":[{"name":"Gürgün Dayıoğlu","email":"hey@gurgun.day","url":"https://heyhey.to/G"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"James Sumners","url":"https://james.sumners.info"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"devDependencies":{"@fastify/pre-commit":"^2.1.0","benchmark":"^2.1.4","busboy":"^1.6.0","content-type":"^1.0.4","eslint":"^9.17.0","neostandard":"^0.12.0","tap":"^19.2.5","tsd":"^0.31.0"},"pre-commit":["lint","test"],"_id":"fast-content-type-parse@2.0.1","gitHead":"9d91aebf7b4c3f45657af2e6b977eedaae89d389","_nodeVersion":"20.18.1","_npmVersion":"10.8.2","dist":{"shasum":"c236124534ee2cb427c8d8e5ba35a4856947847b","size":6343,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-2.0.1.tgz"},"_npmUser":{"name":"fdawgs","email":"frazer.dev@icloud.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-content-type-parse_2.0.1_1735910121566_0.6979407062448275"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-03T13:15:21.735Z","publish_time":1735910121735,"_source_registry_name":"default","_cnpm_publish_time":1735910121735},"2.0.0":{"name":"fast-content-type-parse","version":"2.0.0","description":"Parse HTTP Content-Type header according to RFC 7231","main":"index.js","type":"commonjs","types":"./types/index.d.ts","scripts":{"benchmark":"node benchmarks/simple.js && node benchmarks/simple-ows.js && node benchmarks/with-param.js && node benchmarks/with-param-quoted.js","lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"tap"},"keywords":["content-type","rfc7231"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"devDependencies":{"@fastify/pre-commit":"^2.1.0","benchmark":"^2.1.4","busboy":"^1.6.0","content-type":"^1.0.4","standard":"^17.0.0","tap":"^19.2.5","tsd":"^0.31.0"},"pre-commit":["lint","test"],"_id":"fast-content-type-parse@2.0.0","gitHead":"398557785f83b0f6d3acb836541545dfc7933c6e","bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"shasum":"dea7bfd385e4f18e69f37d309431a4b48470fece","size":6020,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-2.0.0.tgz"},"_npmUser":{"name":"jsumners","email":"james.sumners@gmail.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-content-type-parse_2.0.0_1720904000981_0.2831613639666848"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-13T20:53:21.156Z","publish_time":1720904001156,"_source_registry_name":"default","_cnpm_publish_time":1720904001156},"1.1.0":{"name":"fast-content-type-parse","version":"1.1.0","description":"Parse HTTP Content-Type header according to RFC 7231","main":"index.js","types":"./types/index.d.ts","scripts":{"benchmark":"node benchmarks/simple.js && node benchmarks/simple-ows.js && node benchmarks/with-param.js && node benchmarks/with-param-quoted.js","lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"tap"},"keywords":["content-type","rfc7231"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"devDependencies":{"@fastify/pre-commit":"^2.0.2","benchmark":"^2.1.4","busboy":"^1.6.0","content-type":"^1.0.4","standard":"^17.0.0","tap":"^16.3.2","tsd":"^0.29.0"},"pre-commit":["lint","test"],"gitHead":"fe6d5f68b9eaf76fff6884a31979729713381b73","bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","_id":"fast-content-type-parse@1.1.0","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"shasum":"4087162bf5af3294d4726ff29b334f72e3a1092c","size":5893,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-1.1.0.tgz"},"_npmUser":{"name":"eomm","email":"behemoth89@gmail.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-content-type-parse_1.1.0_1695320099747_0.9570588255382515"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-21T18:14:59.954Z","publish_time":1695320099954,"_source_registry_name":"default","_cnpm_publish_time":1695320099954},"1.0.0":{"name":"fast-content-type-parse","version":"1.0.0","description":"Parse HTTP Content-Type header according to RFC 7231","main":"index.js","types":"./types/index.d.ts","scripts":{"lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"tap"},"keywords":["content-type","rfc7231"],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/fast-content-type-parse.git"},"devDependencies":{"@fastify/pre-commit":"^2.0.2","benchmark":"^2.1.4","busboy":"^1.6.0","content-type":"^1.0.4","standard":"^17.0.0","tap":"^16.3.2","tsd":"^0.25.0"},"pre-commit":["lint","test"],"gitHead":"ddac06dfd59f818b8654e231c345428c61345d22","bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","_id":"fast-content-type-parse@1.0.0","_nodeVersion":"16.17.0","_npmVersion":"9.1.3","dist":{"shasum":"cddce00df7d7efb3727d375a598e4904bfcb751c","size":5960,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-1.0.0.tgz"},"_npmUser":{"name":"uzlopak","email":"aras.abbasi@googlemail.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-content-type-parse_1.0.0_1673260853705_0.9054529193018295"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-09T10:40:53.855Z","publish_time":1673260853855,"_cnpm_publish_time":1673260853855},"0.0.1":{"name":"fast-content-type-parse","version":"0.0.1","description":"","main":"index.js","scripts":{"test":"tap"},"keywords":[],"author":{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.4","busboy":"^1.6.0","content-type":"^1.0.4","tap":"^16.3.2"},"_id":"fast-content-type-parse@0.0.1","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"shasum":"87a667ad6c126c0cd5099c85f923cd1404d17e8f","size":2789,"noattachment":false,"key":"/fast-content-type-parse/-/fast-content-type-parse-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-content-type-parse/download/fast-content-type-parse-0.0.1.tgz"},"_npmUser":{"name":"uzlopak","email":"aras.abbasi@googlemail.com"},"directories":{},"maintainers":[{"name":"climba03003","email":"kaka@kakawebsitedemo.com"},{"name":"eomm","email":"behemoth89@gmail.com"},{"name":"fdawgs","email":""},{"name":"gurgunday","email":""},{"name":"ivan-tymoshenko","email":""},{"name":"jsumners","email":"james.sumners@gmail.com"},{"name":"matteo.collina","email":""},{"name":"metcoder95","email":""},{"name":"simoneb","email":"simone.busoli@gmail.com"},{"name":"uzlopak","email":""},{"name":"zekth","email":"vince.legoff@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-content-type-parse_0.0.1_1672990808174_0.4260451149480837"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-06T07:40:15.176Z","publish_time":1672990808353,"_cnpm_publish_time":1672990808353}},"readme":"# fast-content-type-parse\n\n<div align=\"center\">\n\n[![NPM version](https://img.shields.io/npm/v/fast-content-type-parse.svg?style=flat)](https://www.npmjs.com/package/fast-content-type-parse)\n[![NPM downloads](https://img.shields.io/npm/dm/fast-content-type-parse.svg?style=flat)](https://www.npmjs.com/package/fast-content-type-parse)\n[![CI](https://github.com/fastify/fast-content-type-parse/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fast-content-type-parse/actions/workflows/ci.yml)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n[![Security Responsible Disclosure](https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg)](https://github.com/fastify/.github/blob/main/SECURITY.md)\n\n</div>\n\nParse HTTP Content-Type header according to RFC 7231.\n\n## Installation\n\n```sh\n$ npm install fast-content-type-parse\n```\n\n## Usage\n\n```js\nconst fastContentTypeParse = require('fast-content-type-parse')\n```\n\n### fastContentTypeParse.parse(string)\n\n```js\nconst contentType = fastContentTypeParse.parse('application/json; charset=utf-8')\n```\n\nParse a `Content-Type` header. Throws a `TypeError` if the string is invalid.\n\nIt will return an object with the following properties (examples are shown for\nthe string `'application/json; charset=utf-8'`):\n\n - `type`: The media type (the type and subtype, always lowercase).\n   Example: `'application/json'`\n\n - `parameters`: An object of the parameters in the media type (name of parameter\n   always lowercase). Example: `{charset: 'utf-8'}`\n\n### fastContentTypeParse.safeParse(string)\n\n```js\nconst contentType = fastContentTypeParse.safeParse('application/json; charset=utf-8')\n```\n\nParse a `Content-Type` header. It will not throw an Error if the header is invalid.\n\nThis will return an object with the following\nproperties (examples are shown for the string `'application/json; charset=utf-8'`):\n\n - `type`: The media type (the type and subtype, always lowercase).\n   Example: `'application/json'`\n\n - `parameters`: An object of the parameters in the media type (name of parameter\n   always lowercase). Example: `{charset: 'utf-8'}`\n\nIn case the header is invalid, it will return an object\nwith an empty string `''` as type and an empty Object for `parameters`.\n\n## Benchmarks\n\n```sh\nnode benchmarks/index.js\nutil#MIMEType x 1,206,781 ops/sec ±0.22% (96 runs sampled)\nfast-content-type-parse#parse x 3,752,236 ops/sec ±0.42% (96 runs sampled)\nfast-content-type-parse#safeParse x 3,675,645 ops/sec ±1.09% (94 runs sampled)\ncontent-type#parse x 1,452,582 ops/sec ±0.37% (95 runs sampled)\nbusboy#parseContentType x 924,306 ops/sec ±0.43% (94 runs sampled)\nFastest is fast-content-type-parse#parse\n```\n\n## Credits\n\nBased on the npm package `content-type`.\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","_attachments":{},"homepage":"https://github.com/fastify/fast-content-type-parse#readme","bugs":{"url":"https://github.com/fastify/fast-content-type-parse/issues"},"license":"MIT"}