{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"1.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jshttp/media-typer.git"},"devDependencies":{"eslint":"5.7.0","eslint-config-standard":"12.0.0","eslint-plugin-import":"2.14.0","eslint-plugin-markdown":"1.0.0-beta.6","eslint-plugin-node":"7.0.1","eslint-plugin-promise":"4.0.1","eslint-plugin-standard":"4.0.0","mocha":"5.2.0","nyc":"13.1.0"},"engines":{"node":">= 0.8"},"scripts":{"lint":"eslint --plugin markdown --ext js,md .","test":"mocha --reporter spec --check-leaks --bail test/","test-cov":"nyc --reporter=html --reporter=text npm test","test-travis":"nyc --reporter=text npm test"},"gitHead":"dbe811acb83855b086667271010d3b105aeb6e34","bugs":{"url":"https://github.com/jshttp/media-typer/issues"},"homepage":"https://github.com/jshttp/media-typer#readme","_id":"media-typer@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"integrity":"sha512-MKXtlq1YKUow2wpJlJ7ep1MU6jQR0BaKpkDyrE294cmNSbhoOU1yziJ4UZOU1guFxcEaFt5t4LHsL/t891D6BQ==","shasum":"ca89611f8e31b936efcb3aa90826772f135e3341","tarball":"http://registry-npm.ywwl.com/media-typer/download/media-typer-1.0.0.tgz","fileCount":5,"unpackedSize":8331,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJby98nCRA9TVsSAnZWagAA4d8P/A+KHvncQuvDCGeEBhDT\nNS32nytG/grOSzaMcv/L3KA9zAHBWyYa0EmBQ5Iyvd2A1jk12yKW5FsonQNO\n2Q+FMWW8fzo2pJtV6KB7FGgTJ6oWfViT86c4gjZTnJ6sZBe5z30Ai/5hSk6g\nAv749aM7qgX88RysFGRsbq38rKwmV4LIvLqYFT+knDo+R1A72rFjZLtWSe2a\nfrjdhfz3+f5S0Mj6GWdtgmn6zARFlIi6SyJrrNjoOumQXDRHQt3rgicEgBCR\nztwlnBjFXPCBj6+xK5mIqNP4XJMv1W0DRplP1WWfChTUy+8SU3PMTmE3n0gV\nvx1nBWWrFaZFRsBSp6l6qD5Am4JO/RlFV/GS09OxL93+R/gL+BnGY6uEZhcr\n5d2SDrLAzzznBz6q5KCI3wV8Fx0jNQyibw1XaJ75BL72HsCV1TWU9ZVeGCau\n32/J7ZuRsPkn+adujX6ffIi5+oeFBHkl+NuCvtEZT8nknPw/CsoPYEZ7SA3F\nX+yBPf8fPXiNIk0FrdVtMJvMT2ueaoEw3+hzzmEfwC6Lq25VYTOqdpsbyTiw\n0+Uor6Oe9sYwIZy05pc25PJdJvwHn3LaDLA8Y8PAjntDWNMd8nW2ZnXGVtLE\nia74S0Pqi55M/ARn9DiGe4H/4n77GEQyYuSWIiJheo71mY2/Y8M3OgHGLY4r\nNlif\r\n=3F90\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaSUkB/C4F+bQXkUVi049XPD885dVMyqLEKd270vYAuAiEAoZYsIqoCjFD98VCTM/htSY/jpMOGwqay9FreEZ2XLYY="}],"size":3473,"noattachment":false,"key":"/media-typer/-/media-typer-1.0.0.tgz"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/media-typer_1.0.0_1540087590178_0.03604841955092852"},"_hasShrinkwrap":false,"readme":"# media-typer\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-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\nThis module will parse a given media type into it's component parts, like type,\nsubtype, and suffix. A formatter is also provided to put them back together and\nthe two can be combined to normalize media types into a canonical form.\n\nIf you are looking to parse the string that represents a media type and it's\nparameters in HTTP (for example, the `Content-Type` header), use the\n[content-type module](https://www.npmjs.com/package/content-type).\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm install media-typer\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nvar typer = require('media-typer')\n```\n\n### typer.parse(string)\n\n<!-- eslint-disable no-undef, no-unused-vars -->\n\n```js\nvar obj = typer.parse('image/svg+xml')\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\nIf the given type string is invalid, then a `TypeError` is thrown.\n\n### typer.format(obj)\n\n<!-- eslint-disable no-undef, no-unused-vars -->\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\nIf any of the given object values are invalid, then a `TypeError` is thrown.\n\n### typer.test(string)\n\n<!-- eslint-disable no-undef, no-unused-vars -->\n\n```js\nvar valid = typer.test('image/svg+xml')\n```\n\nValidate a media type string. This will return `true` is the string is a well-\nformatted media type, or `false` otherwise.\n\n## License\n\n[MIT](LICENSE)\n\n[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/media-typer/master\n[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master\n[node-version-image]: https://badgen.net/npm/node/media-typer\n[node-version-url]: https://nodejs.org/en/download\n[npm-downloads-image]: https://badgen.net/npm/dm/media-typer\n[npm-url]: https://npmjs.org/package/media-typer\n[npm-version-image]: https://badgen.net/npm/v/media-typer\n[travis-image]: https://badgen.net/travis/jshttp/media-typer/master\n[travis-url]: https://travis-ci.org/jshttp/media-typer\n","publish_time":1540087590337,"_cnpm_publish_time":1540087590337,"dist-tags":{"latest":"2.0.0","legacy":"1.1.1"}}