{"name":"it-multipart","version":"0.0.2","description":"Async iterable http multipart message parser","main":"index.js","repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-multipart.git"},"homepage":"https://github.com/achingbrain/it-multipart#readme","bugs":{"url":"https://github.com/achingbrain/it-multipart/issues"},"scripts":{"test":"ava","lint":"standard"},"author":{"name":"Alex Potsides","email":"ale@achingbrain.net"},"license":"ISC","dependencies":{"buffer-indexof":"^1.1.1","parse-headers":"^2.0.2"},"devDependencies":{"ava":"^2.2.0","form-data":"^2.5.0","node-fetch":"^2.6.0","standard":"^13.1.0"},"gitHead":"12fcc831a3a1458b266a49193854fa55368b4553","_id":"it-multipart@0.0.2","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Mlvf1Tt+gLyk5EkE9njjfDCuvf5+3rx1vDt271MT7Ye08/3yJL/h+M/EWhPBPLebmNrkfXUQOGl8ud4T9PzuWA==","shasum":"83e8d55aec54026340e94ea9f7928266597adb20","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-0.0.2.tgz","fileCount":4,"unpackedSize":7510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdV7L1CRA9TVsSAnZWagAA1c0QAKUpQ+ahuorSqRaQHibq\nP354J58IM+sd1cOvg4XRkBNbn52PCKmiIr/sqfXwQeXj0FjQGA16BlATHA4n\nAYA5EuQl46+i1Tg3a3WcL8+ToO+08gyljMlA8x9YT8qUUeEvbTVOOVCY6djG\n1CxZCaAUEklhV/ZhSdRwm2ykpp98vHq8rUKcs0zzFUsVCnJ5Hz1CU2Ii4FZ9\ne6cqVzOo60Ok06EXanz+ICDTFm3ns73JBSZ3CzsV2suKssL/AUwWn39Mh98m\nMMDvC85R4rn/ZWaSVF6ZuJCNdmaX+gJkbNGkOOD8GrfHQcWu7SgGMJd+o7+n\ns/FmrlWq6ihQcTQKUbj7tPZNqYY1hBWB0BRtKfcTpsCgTBq37FBJDXvfxNmt\n4x3TNlM01934QbMWAPC1tx6VMak5p3QRRs1vQejndpDt5O9lr7ST5Ex62S3P\nzNLY3OqPh5fLs5erg1zPfLMsqlkqViz5zQmfdmvTOu+LEEBQPfPytWXKclvL\n9OhG/7n5iu2+KJG+F9w84lSqHjlof2oQe0fm6m53xjym6LPRakX+Ghd0F/re\nK+suLPsqbc3cnPHT9u890WFJFBJe8VcYaHh/eRbP6VSHFClsNjKdG76cVmNq\ntrO/znWvPXnvMBljIabZtOKxFktmFdra6KwvxuZXAOdutBbf186ChARic8W2\nhM4g\r\n=dSFQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5J9fhH6Su/5/7xhCnx+gyfNKF7lKFenwxyBHEoIO0/QIgc0P4kQ9OHDakmI+cGV1PnqcjsQZJ8O3vKprE2+yURzs="}],"size":2722,"noattachment":false,"key":"/it-multipart/-/it-multipart-0.0.2.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-multipart_0.0.2_1566028533213_0.06072701663737323"},"_hasShrinkwrap":false,"readme":"# it-multipart\n\n[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)\n[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Async iterable http multipart message parser\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nAllows iterating over multipart messages found in a HTTP request/\n\n## Example\n\n```javascript\nimport http from 'http'\nimport multipart from 'it-multipart'\n\nhttp.createServer(async (req, res) => {\n  if (req.method === 'POST' && req.headers['content-type']) {\n    for await (const part of multipart(req)) {\n      console.log(`part with HTTP headers ${part.headers}`)\n\n      // nb. part.body must be consumed before the next part is emitted\n      for await (const chunk of part.body) {\n        console.log(`part with content ${part.name} contents:`, chunk.toString())\n      }\n    }\n\n    console.log('finished parsing')\n    res.writeHead(200)\n    res.end()\n  }\n\n  res.writeHead(404)\n  res.end()\n}).listen(5001, () => {\n  console.log('server listening on port 5001')\n})\n```\n\n# Install\n\n```console\n$ npm i it-multipart\n```\n\n# API Docs\n\n- <https://achingbrain.github.io/it/modules/it_multipart.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/it-multipart/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-multipart/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1566028533435,"_cnpm_publish_time":1566028533435,"dist-tags":{"latest":"4.0.0"}}