{"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"keywords":["content-type","http","req","res","rfc7231"],"dist-tags":{"latest":"1.0.2"},"author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"description":"Create and parse HTTP Content-Type header","readme":"# content-type\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nCreate and parse HTTP Content-Type header according to RFC 7231\n\n## Installation\n\n```sh\n$ npm install content-type\n```\n\n## API\n\n```js\nvar contentType = require('content-type')\n```\n\n### contentType.parse(string)\n\n```js\nvar obj = contentType.parse('image/svg+xml; charset=utf-8')\n```\n\nParse a content type string. This will return an object with the following\nproperties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):\n\n - `type`: The media type (the type and subtype, always lower case).\n   Example: `'image/svg+xml'`\n\n - `parameters`: An object of the parameters in the media type (name of parameter\n   always lower case). Example: `{charset: 'utf-8'}`\n\nThrows a `TypeError` if the string is missing or invalid.\n\n### contentType.parse(req)\n\n```js\nvar obj = contentType.parse(req)\n```\n\nParse the `content-type` header from the given `req`. Short-cut for\n`contentType.parse(req.headers['content-type'])`.\n\nThrows a `TypeError` if the `Content-Type` header is missing or invalid.\n\n### contentType.parse(res)\n\n```js\nvar obj = contentType.parse(res)\n```\n\nParse the `content-type` header set on the given `res`. Short-cut for\n`contentType.parse(res.getHeader('content-type'))`.\n\nThrows a `TypeError` if the `Content-Type` header is missing or invalid.\n\n### contentType.format(obj)\n\n```js\nvar str = contentType.format({type: 'image/svg+xml'})\n```\n\nFormat an object into a content type string. This will return a string of the\ncontent type for the given object with the following properties (examples are\nshown that produce the string `'image/svg+xml; charset=utf-8'`):\n\n - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`\n\n - `parameters`: An object of the parameters in the media type (name of the\n   parameter will be lower-cased). Example: `{charset: 'utf-8'}`\n\nThrows a `TypeError` if the object contains an invalid type or parameter names.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/content-type.svg\n[npm-url]: https://npmjs.org/package/content-type\n[node-version-image]: https://img.shields.io/node/v/content-type.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg\n[travis-url]: https://travis-ci.org/jshttp/content-type\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/content-type\n[downloads-image]: https://img.shields.io/npm/dm/content-type.svg\n[downloads-url]: https://npmjs.org/package/content-type\n","repository":{"type":"git","url":"git+https://github.com/jshttp/content-type.git"},"users":{"goodseller":true,"simplyianm":true,"qqqppp9998":true,"rocket0191":true,"snowdream":true,"rbecheras":true},"bugs":{"url":"https://github.com/jshttp/content-type/issues"},"license":"MIT","versions":{"0.0.1":{"name":"content-type","version":"0.0.1","description":"Javascript/ECMAScript library for parsing Content-Type and Media/MIME type strings","main":"content-type.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/deoxxa/content-type.git"},"keywords":["content-type","parse","http","header"],"author":{"name":"Austin Wright","email":"https://github.com/Acubed"},"license":"Unlicense <http://unlicense.org/>","bugs":{"url":"https://github.com/deoxxa/content-type/issues"},"_id":"content-type@0.0.1","dist":{"shasum":"b8dd2786f814b2c8d0985fdbea8a3d361366ea80","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/content-type/-/content-type-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"}],"directories":{}},"1.0.0":{"name":"content-type","description":"Create and parse HTTP Content-Type header","version":"1.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["content-type","http","req","res","rfc7231"],"repository":{"type":"git","url":"https://github.com/jshttp/content-type"},"devDependencies":{"istanbul":"0.3.5","mocha":"~1.21.5"},"files":["LICENSE","HISTORY.md","README.md","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --reporter spec --check-leaks --bail test/","test-ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"},"gitHead":"31266966b656ace33556e8dfd432b0790df82870","bugs":{"url":"https://github.com/jshttp/content-type/issues"},"homepage":"https://github.com/jshttp/content-type","_id":"content-type@1.0.0","_shasum":"2b66ca456422371bd04e63fdda92501210f40be4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},{"name":"dougwilson","email":"doug@somethingdoug.com"}],"dist":{"shasum":"2b66ca456422371bd04e63fdda92501210f40be4","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/content-type/-/content-type-1.0.0.tgz"},"directories":{}},"1.0.1":{"name":"content-type","description":"Create and parse HTTP Content-Type header","version":"1.0.1","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["content-type","http","req","res","rfc7231"],"repository":{"type":"git","url":"https://github.com/jshttp/content-type"},"devDependencies":{"istanbul":"0.3.5","mocha":"~1.21.5"},"files":["LICENSE","HISTORY.md","README.md","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --reporter spec --check-leaks --bail test/","test-ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"},"gitHead":"3aa58f9c5a358a3634b8601602177888b4a477d8","bugs":{"url":"https://github.com/jshttp/content-type/issues"},"homepage":"https://github.com/jshttp/content-type","_id":"content-type@1.0.1","_shasum":"a19d2247327dc038050ce622b7a154ec59c5e600","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"dist":{"shasum":"a19d2247327dc038050ce622b7a154ec59c5e600","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/content-type/-/content-type-1.0.1.tgz"},"directories":{}},"1.0.2":{"name":"content-type","description":"Create and parse HTTP Content-Type header","version":"1.0.2","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["content-type","http","req","res","rfc7231"],"repository":{"type":"git","url":"git+https://github.com/jshttp/content-type.git"},"devDependencies":{"istanbul":"0.4.3","mocha":"~1.21.5"},"files":["LICENSE","HISTORY.md","README.md","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --reporter spec --check-leaks --bail test/","test-ci":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"},"gitHead":"8118763adfbbac80cf1254191889330aec8b8be7","bugs":{"url":"https://github.com/jshttp/content-type/issues"},"homepage":"https://github.com/jshttp/content-type#readme","_id":"content-type@1.0.2","_shasum":"b7d113aee7a8dd27bd21133c4dc2529df1721eed","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"shasum":"b7d113aee7a8dd27bd21133c4dc2529df1721eed","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/content-type/-/content-type-1.0.2.tgz"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/content-type-1.0.2.tgz_1462852785748_0.5491233412176371"},"directories":{}}},"name":"content-type","time":{"modified":"2017-07-25T10:13:57.986Z","created":"2013-10-08T07:37:45.765Z","0.0.1":"2013-10-08T07:37:54.398Z","1.0.0":"2015-02-02T07:31:29.037Z","1.0.1":"2015-02-14T00:37:57.925Z","1.0.2":"2016-05-10T03:59:48.395Z"},"readmeFilename":"README.md","homepage":"https://github.com/jshttp/content-type#readme"}