{"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"dist-tags":{"latest":"0.3.0"},"author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"description":"Simple RFC 6838 media type parser and formatter","readme":"# media-typer\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\nSimple RFC 6838 media type parser\n\n## Installation\n\n```sh\n$ npm install media-typer\n```\n\n## API\n\n```js\nvar typer = require('media-typer')\n```\n\n### typer.parse(string)\n\n```js\nvar obj = typer.parse('image/svg+xml; charset=utf-8')\n```\n\nParse a media 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 type of the media type (always lower case). Example: `'image'`\n\n - `subtype`: The subtype of the media type (always lower case). Example: `'svg'`\n\n - `suffix`: The suffix of the media type (always lower case). Example: `'xml'`\n\n - `parameters`: An object of the parameters in the media type (name of parameter always lower case). Example: `{charset: 'utf-8'}`\n\n### typer.parse(req)\n\n```js\nvar obj = typer.parse(req)\n```\n\nParse the `content-type` header from the given `req`. Short-cut for\n`typer.parse(req.headers['content-type'])`.\n\n### typer.parse(res)\n\n```js\nvar obj = typer.parse(res)\n```\n\nParse the `content-type` header set on the given `res`. Short-cut for\n`typer.parse(res.getHeader('content-type'))`.\n\n### typer.format(obj)\n\n```js\nvar obj = typer.format({type: 'image', subtype: 'svg', suffix: 'xml'})\n```\n\nFormat an object into a media type string. This will return a string of the\nmime type for the given object. For the properties of the object, see the\ndocumentation for `typer.parse(string)`.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/media-typer.svg?style=flat\n[npm-url]: https://npmjs.org/package/media-typer\n[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/media-typer.svg?style=flat\n[travis-url]: https://travis-ci.org/jshttp/media-typer\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/media-typer.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/jshttp/media-typer\n[downloads-image]: https://img.shields.io/npm/dm/media-typer.svg?style=flat\n[downloads-url]: https://npmjs.org/package/media-typer\n","repository":{"type":"git","url":"https://github.com/jshttp/media-typer"},"users":{"mojaray2k":true},"bugs":{"url":"https://github.com/jshttp/media-typer/issues"},"license":"MIT","versions":{"0.0.0":{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"0.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/expressjs/media-typer"},"devDependencies":{"istanbul":"0.2.10","mocha":"~1.20.1","should":"~4.0.4"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"},"bugs":{"url":"https://github.com/expressjs/media-typer/issues"},"homepage":"https://github.com/expressjs/media-typer","_id":"media-typer@0.0.0","dist":{"shasum":"4ee71136eb8612cc771ecfa2bf25ddc153084f5c","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/media-typer/-/media-typer-0.0.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{}},"0.1.0":{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"0.1.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/expressjs/media-typer"},"devDependencies":{"istanbul":"0.2.10","mocha":"~1.20.1","should":"~4.0.4"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"},"bugs":{"url":"https://github.com/expressjs/media-typer/issues"},"homepage":"https://github.com/expressjs/media-typer","_id":"media-typer@0.1.0","dist":{"shasum":"00607eec8005776e49ea593202f5469f703e8060","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/media-typer/-/media-typer-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{}},"0.2.0":{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"0.2.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/expressjs/media-typer"},"devDependencies":{"istanbul":"0.2.10","mocha":"~1.20.1","should":"~4.0.4"},"engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha --reporter dot test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"},"bugs":{"url":"https://github.com/expressjs/media-typer/issues"},"homepage":"https://github.com/expressjs/media-typer","_id":"media-typer@0.2.0","dist":{"shasum":"d8a065213adfeaa2e76321a2b6dda36ff6335984","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/media-typer/-/media-typer-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{}},"0.3.0":{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"0.3.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"https://github.com/jshttp/media-typer"},"devDependencies":{"istanbul":"0.3.2","mocha":"~1.21.4","should":"~4.0.4"},"files":["LICENSE","HISTORY.md","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --reporter spec --check-leaks --bail test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"d49d41ffd0bb5a0655fa44a59df2ec0bfc835b16","bugs":{"url":"https://github.com/jshttp/media-typer/issues"},"homepage":"https://github.com/jshttp/media-typer","_id":"media-typer@0.3.0","_shasum":"8710d7af0aa626f8fffa1ce00168545263255748","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"dist":{"shasum":"8710d7af0aa626f8fffa1ce00168545263255748","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/media-typer/-/media-typer-0.3.0.tgz"},"directories":{}}},"name":"media-typer","time":{"modified":"2016-11-01T17:50:09.577Z","created":"2014-06-13T19:25:11.301Z","0.0.0":"2014-06-13T19:25:11.301Z","0.1.0":"2014-06-18T05:02:41.908Z","0.2.0":"2014-06-18T19:00:35.939Z","0.3.0":"2014-09-08T04:32:24.363Z"},"readmeFilename":"README.md","homepage":"https://github.com/jshttp/media-typer"}