{"name":"media-typer","description":"Simple RFC 6838 media type parser and formatter","version":"1.0.1","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":"1ee51e645afab21855a35fbf95fe6b1e4c852060","bugs":{"url":"https://github.com/jshttp/media-typer/issues"},"homepage":"https://github.com/jshttp/media-typer#readme","_id":"media-typer@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"dist":{"integrity":"sha512-v42gdPIuqYCoDVH5OiaKsVrv6aJqdMWJzl8KCyDs/KeDyBveYp3Wxq4UWJfsWjkSZUNC0xlLfDlLCPa1h/oo+g==","shasum":"e39d677e19a011c52d2681f430d1adafb299dd41","tarball":"http://registry-npm.ywwl.com/media-typer/download/media-typer-1.0.1.tgz","fileCount":5,"unpackedSize":8346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJby+HDCRA9TVsSAnZWagAALRcP/jsONa6K4aEKiHKqqmU+\nNryRP9TBIgMxtSRaXP2lU+2BqeQRAPFtxa7H4SaFyyM6QLI/I3G3C1LDltXx\nKcmaWPzGHNJZ6aFVqiNgn7nia+/vGiciP/ZeEg1AKy6vFbkKVMuk3AOQVYO0\nMhByAAVLTKBRqMtuMqv2AH7tHQLSMNJCvHQMelQAOruHz8wbE9Pg189uWaud\npm0sD0eqVw6L1VD7A8XtA0TcyidcnytIIgq/uSr6sES6sFIBTtCafbFaz/X3\nrdm4Fiv1jynEN5Q5PWO9sTCIBeJ3gdlTm43EkXS98ggR6pPqYTujTdI15SCJ\nnM1qaMUR3k+2BAZttjD1v+gvtI5U3nl/jgdTWCt0oQlQ3GgO8TjO43RHKYmR\nP4LylGuve7oih6Sf6/MDOi/QPReLiQW4FBdAxCB8jkKjiVV5YEZ4XmlaO2sd\ny/YMcoxBrROebWcjmlFXROfAs2ianwxTD7lhe7YnjghGIf2m+BxFWJF0xLga\n+5op2MR/GCbf93BiV9RguUnfyaRohgmo3acIc4Fm/+M52nMrMS3dyiOxvCRD\n+cjiLJxHUsf192Y9vgbXMxlBqUzr6lGzSQAPpDScImHZzxC6AU3LVNOVCCDU\noMd/a96idMBHmCUC0dXn4WhYGDTjNRAcaj8PTE8vENp66fEbp4/wWFfWVM4h\nuvVC\r\n=0v4D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCG+1J4L/K42JRYsTrcbZ5Ig+MyRMSOVr5Z+YfOnftu8gIhANK/LK3TvOGXGAPTdQs5WObiLFQLawoYzBgiw2B73YYa"}],"size":3484,"noattachment":false,"key":"/media-typer/-/media-typer-1.0.1.tgz"},"maintainers":[{"name":"dougwilson","email":"doug@somethingdoug.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/media-typer_1.0.1_1540088258485_0.9356881090496065"},"_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":1540088258605,"_cnpm_publish_time":1540088258605,"dist-tags":{"latest":"2.0.0","legacy":"1.1.1"}}