{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"1.0.2","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.16.0","eslint-config-standard":"12.0.0","eslint-plugin-import":"2.16.0","eslint-plugin-markdown":"1.0.0","eslint-plugin-node":"8.0.1","eslint-plugin-promise":"4.1.1","eslint-plugin-standard":"4.0.0","mocha":"6.1.4","nyc":"14.0.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":"95189ea17b0ff63132f027c746ae6eb1b2c783e1","bugs":{"url":"https://github.com/jshttp/media-typer/issues"},"homepage":"https://github.com/jshttp/media-typer#readme","_id":"media-typer@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.15.1","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"integrity":"sha512-/ky7iFD18Y2mN5BdOS4zotSSgu11BsIR2l3L7eK2bTaRWQidoSBmSxGgMFd/XOSGyivlhtQUdDLoUzlr1PWb1g==","shasum":"e64b0a709d52c158ddedaf38ebebfa00d8e02c14","tarball":"http://registry-npm.ywwl.com/media-typer/download/media-typer-1.0.2.tgz","fileCount":5,"unpackedSize":8562,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcukLZCRA9TVsSAnZWagAADM8P/RDVhBWP4o9R/32p6fdI\nVr8PGyNgx0K6s0A6KVOis0x2YwXRHCZKYIP/DXjsstTd4qQ/sT2QQVDTkS8s\ndeTYEQ2W/nvjNymWxPtbkfgZ4fdGFa+QFNoZhQCjg3fbrze2Ym1MPehlAi9G\nw9Li0tIxKQgy9LcXyBC/lPiQdm8Ip5wOvihfVOd4Jm7dyT4NgKem41oKNF8L\nLQIbguAHGE9ET/s8nvLe6WI9IK3CUD7BN4fTLs6ypOJKm3leLDCmzEkwd1Yq\ndvI4WKg/sZ1jYi436OJBaYfzP/kJZDYWT4Hghqh1p4y/WQF3GumRhoPRVSfR\nmBARnlBniHYPoCchPXmSLr4NbKO8ceITFeelxgi42AJzAY4UQU1QP2jjP8LS\nCBo6jmMiePIPLuIN/oOKejtIX8EDsWZelAXDH1jE038PqXp22U2j0KmqPc0m\nmkXBLDOAECvnsqvMqawEJzjJi639EBuRf3tFBnQZGqLoNSDPEtJNJxxMy6zA\nJjjR5zsrlvfX+07NeJHjNB4vutas8sOb/T3aZxc/7VWFgJoDApP+vsoxuQy9\nlvhLPoc+Ew/uXqOt3GwZM27g1caqdVmJolrTzpjKk7GLUR9GoedWcsTCTJZy\nimhjRmbJT24q23z99eeJO1GaraRtxOe3KaLwYpjhTFC1aKJcuH3Yp5CDF3Sp\nYhBE\r\n=e9ga\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQxQHKR5v8iKrSSGbb7BWn7JgmERGaWfaExkhnAtoDugIhANpq8hmEacUuHeHRgo+WgmC/xKYRSS86iqEEFvuJKRKf"}],"size":3555,"noattachment":false,"key":"/media-typer/-/media-typer-1.0.2.tgz"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/media-typer_1.0.2_1555710681221_0.029165072776340617"},"_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":1555710681389,"_cnpm_publish_time":1555710681389,"dist-tags":{"latest":"2.0.0","legacy":"1.1.1"}}