{"name":"it-multipart","version":"1.0.2","description":"Async iterable http multipart message parser","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"homepage":"https://github.com/achingbrain/it#readme","bugs":{"url":"https://github.com/achingbrain/it/issues"},"scripts":{"test":"ava","lint":"standard","coverage":"nyc --reporter html --reporter lcov ava","clean":"rm -rf .nyc_output coverage"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"ISC","dependencies":{"buffer":"^5.5.0","buffer-indexof":"^1.1.1","parse-headers":"^2.0.2"},"devDependencies":{"ava":"^2.4.0","form-data":"^2.5.0","node-fetch":"^2.6.0","nyc":"^14.0.0","standard":"^14.3.1"},"gitHead":"89e50d95752a8cf3b258d0a5cafa5f20772e49f4","_id":"it-multipart@1.0.2","_nodeVersion":"12.16.1","_npmVersion":"lerna/3.19.0/node@v12.16.1+x64 (darwin)","dist":{"integrity":"sha512-nUdSYGzhl3DYJSFEzAcMm/3ycMfZ0h0p2XQ8K8wEfT7fRlGVtWN5YZXeIZemPHe/bIHVwXch6FCZzIhGukmiGw==","shasum":"e4f0bd391565ba47e92d0c0b5b27c98d14e81959","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-1.0.2.tgz","fileCount":4,"unpackedSize":8532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeetdCRA9TVsSAnZWagAA2DUP/0aGUDkFUzG3wJn+33t8\nDCERP1S3Dbn36Rqcbv8KTiYbyM62BEDtZvpVKJHqytzpG6dKK/aQa7urJBJb\nxHFLb1De6eqCaMKNuZPEBADg18Klv31Fdr71xqL1BGoOMyNKEFaUFVC7rs3F\nGHv21HdNny9q5a5tOUaClEbTF0YLaFKtvrs1xRjIVofYVg9dV9HX5RQQ3P9r\nGy2qaCb0j1ymtyft0AbUjJgEXXf1dzO0LSjAdXBtyYJQ5C5f3dFcg+3bKzkI\nvdjJl0jtkU9yExheKmDVcGoi3WhxWewlhJ8oNSiVRJNlbng77v9oNSV8pRKh\nfH+Rz4XbA1EOCw5dxnAkuXJogW3gAHuL+38YCUd2m0BDkncELyBfuQB6PqVw\nj+6Q/cwQIWySSAqumI3wXTaxE+Au5oSmB0+l2QEEioQ+ZjUyO1YXPd8xM+C3\nef++4qrB7JWB+PwY3jQHcMGMkoJ2czETmGqTtLywWRitYvFNKdIw7QKf/cVJ\nyNY3MCrD9LxKdAMEOF8zb1FmjqQGlrMpOAb8kkBHKatdCyUSotE+NgDDHNKK\nemdFrBR19QClMd3cnMo7qkX5OEb0MXQ/Pm5d9LRjKTKww9FXp8NnK+i9WjLx\nmZzEYKOFjLzWZE9v9+1uvxJdVmmVuLcFS1b+YRuPkP3FTpdnIg8WvEvoFyX+\nVmpO\r\n=kI56\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICO9BKkb1tZ8fBgaAalgY9w6ehrZnr9fZjXvrLRfYzL8AiEA1k5ibPM4ZhLjXuxh/68onwl/OsyVbp2Jhec6AYzqPSU="}],"size":3037,"noattachment":false,"key":"/it-multipart/-/it-multipart-1.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_1.0.2_1585048413004_0.602541808815308"},"_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":1585048413129,"_cnpm_publish_time":1585048413129,"dist-tags":{"latest":"4.0.0"}}