{"bugs":{"url":"https://github.com/hapijs/content/issues"},"dist":{"shasum":"0cbb88e82702d35ccf59800b8add609bb5c1dfc2","tarball":"https://registry.npmjs.org/content/-/content-3.0.7.tgz","fileCount":5,"integrity":"sha512-LXtnSnvE+Z1Cjpa3P9gh9kb396qV4MqpfwKy777BOSF8n6nw2vAi03tHNl0/XRqZUyzVzY/+nMXOZVnEapWzdg==","signatures":[{"sig":"MEUCIEEKnyAF1qHm0xW2BDsRS67heH6IMyAD6Wv+Fa/e9kpFAiEAkeaFo4e8GPOMGgeK4py3Ay7mcWW3ubGLwAO6OG4wISU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8107},"main":"lib/index.js","name":"content","readme":"# content\n\nHTTP Content-* headers parsing.\n\n[![NPM Version](https://badge.fury.io/js/content.svg)](http://badge.fury.io/js/content)\n[![Build Status](https://secure.travis-ci.org/hapijs/content.svg)](http://travis-ci.org/hapijs/content)\n[![Dependencies](https://david-dm.org/hapijs/content.svg)](https://david-dm.org/hapijs/content)\n\nLead Maintainer - [Rui Quelhas](https://github.com/ruiquelhas)\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n    - [`type(header)`](#typeheader)\n    - [`disposition(header)`](#dispositionheader)\n\n## Installation\n\nInstall via [NPM](https://www.npmjs.org).\n\n```\n$ npm install content\n```\n\n## Usage\n\n**content** allows to parse HTTP `Content-*` headers, currently based on the rules established in both [RFC 7231 Section 3.1.1.1](https://tools.ietf.org/html/rfc7231#section-3.1.1.1) and [RFC 6266 Section 4.1](http://tools.ietf.org/html/rfc6266#section-4.1).\n\n### `type(header)`\n\nGenerates an object containing the associated mime-type and the boundary (if specified).\n\n```js\nContent.type('application/json; some=property; and=\"another\"');\n// { mime: 'application/json' }\n\nContent.type('application/json; boundary=asdf');\n// { mime: 'application/json', boundary: 'asdf' }\n```\n\nIf the header is invalid (malformed) or missing required data, such as a `multipart/form-data` header missing its `boundary`, it returns an HTTP `Bad Request` error.\n\n### `disposition(header)`\n\nGenerates an object containing the details related to the `Content-Disposition` header for the `form-data` content type with support for `utf8` encoding.\n\n```js\nContent.disposition('form-data; name=\"file\"; filename=file.jpg');\n// { name: 'file', filename: 'file.jpg' }\n\nContent.disposition('form-data; name=\"file\"; filename*=utf-8\\'en\\'with%20space');\n// { name: 'file', filename: 'with space' }\n```\n\nIf the header is invalid (malformed, invalid or missing properties) or is empty/missing, it returns an explanatory error.\n\n","engines":{"node":">=4.5.0"},"gitHead":"dd3901f1732a24ea902452e0bc40f0ccb09ebf46","license":"BSD-3-Clause","scripts":{"test":"lab -a code -t 100 -L","test-tap":"lab -a code -r tap -o tests.tap","test-cov-html":"lab -a code -r html -o coverage.html"},"_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"homepage":"https://github.com/hapijs/content#readme","keywords":["HTTP","header","content","content-type","content-disposition"],"deprecated":"This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).","repository":{"url":"git://github.com/hapijs/content.git","type":"git"},"_npmVersion":"5.6.0","description":"HTTP Content-* headers parsing","directories":{},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"},{"name":"marsup","email":"nicolas@morel.io"},{"name":"nlf","email":"quitlahok@gmail.com"},{"name":"wyatt","email":"wpreul@gmail.com"}],"_nodeVersion":"8.9.1","dependencies":{"boom":"5.x.x"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"lab":"14.x.x","code":"4.x.x"},"_npmOperationalInternal":{"tmp":"tmp/content_3.0.7_1519895166561_0.6134984029140398","host":"s3://npm-registry-packages"},"_id":"content@3.0.7","version":"3.0.7"}