{"name":"it-multipart","version":"0.0.1","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":"9d96116158df3d291eb647b5c1682f268cc51cd8","_id":"it-multipart@0.0.1","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-fzfXoqxkcujc0HCnAbh8tgq7OTknpGshh3HSlsZFv4dVaI8IEGB1fYu4wkdZ/oEHSpTCVAhTt5kONcTfvOyQpQ==","shasum":"a58698420ca075371bd56ac439a054885209efd5","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-0.0.1.tgz","fileCount":4,"unpackedSize":7430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVunDCRA9TVsSAnZWagAACfIP/0U6ykRlNKejraNq/3Se\neDJ3ZhZHWZMphlT/HbfBs10uia9Zx8hwvqh1MSYfjfGgbj+m1IFtvaEJ6tsy\ntL4iIjFDlm61+lhoxJGgsdFOkWfO5s8c7KEwlD1pypUzhnhR9g7h+OpB7lTF\nbkBsV2RlyjFLHZmH2+KXU31QdH1UqXX7rHhZsXbEKsROptot7lEXIQSEAONc\neee8QPAv2Wi21hK0enMxH4d3IP+5RM4IVQvn5PLJY/zQYHotETww18IsQ4YL\nfZ8It7rVIGGGSJbyKQqG6XSnt/mHdf0ESJR7lFZUy12Eol7nyN44+YK7Vmyn\n/gsheZpLqKWOBJvmNCNl3Yns1XSYJ7kNTyXrnXpMTLeYoroZFP54lHKZy3Vd\nVjhFHci1boRhdKYKQQR8+sRy6Vo2nyBZy6YMg/NpTjZMsZyUDkFl+vhLq3g5\nkLcFCXU1jRVzlMZkpNQ1Rx/K4dBioIh43fSm5EXGuAus8b3yxut9/ZU06DgH\n/rXxoxGO7+jbPgv+Ij+0jjPxsYpPmz8oBRVr9tJ3JhBLHgWQpiKddgM3TDLU\nKcuRrZ2NaSeB6y7MNN2WWXzJrIeuBcUgucE/xC4vkbZiupgTI3YuO3Ya1qMc\nbPVkcXx2Pfq4b6nfpCGxdL/8zNd6IIwf7dZ4DWKvgTUGQApsDSI6GV7toAyo\nvrQ8\r\n=6upH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSZ6zCc7ewx5KvGMNKyAdCxQaan+Mqr9VASRlo0uS+XAiBA3ZKPY6mTi7lRzTOZsuU+SjBBBeGiMdGfGTtxTufF5w=="}],"size":2710,"noattachment":false,"key":"/it-multipart/-/it-multipart-0.0.1.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.1_1565977026249_0.49114057586456705"},"_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":1565977026898,"_cnpm_publish_time":1565977026898,"dist-tags":{"latest":"4.0.0"}}