{"name":"it-multipart","version":"1.0.0","description":"Async iterable http multipart message parser","main":"index.js","repository":{"type":"git","url":"git+https://github.com/achingbrain/it-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":"alex@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":"4843949851cf057f57a15c78a05719f6430a3f53","_id":"it-multipart@1.0.0","_nodeVersion":"10.16.2","_npmVersion":"6.11.3","dist":{"integrity":"sha512-DXn2Bo+on1hsWXSoP64UqQxDdzzlWtY5G6gm3oqMto5qwiUTb43Wx3RgOQT0IN38zR+MMdELu1vGHgm1P9h9Ug==","shasum":"9962b684fa9ae174f14a28ed3ee6fac6c6e0b267","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-1.0.0.tgz","fileCount":4,"unpackedSize":7931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeeNnCRA9TVsSAnZWagAAINUP/jPCCZPH3NICpY/xRZvC\nXVovwUUQmmcsVjvKSi4TSZjuWLAQRxG4d5euZx0bzrFTqvOjX5mJs3SOVPk+\nvfjg9Fxka9l5N0X285Z6ryWOEzR4xtFl0QboBcb5WeLr2ca8fxzQXdpOOCc4\nnFNbKZ3tO9nunePP6PdIRJVnY2cokRN9PifpOVw7yeLuwKSGUE7/WHulyudU\n+hOkbf2Jz3335FDqDlIg+VGh9be0EEt5nMEPSxLeP3GVIyXVaYyuxnp6HJdv\nZo4h1O/WxYWglSMeHgucPzi1kIpe434RtjwrV6J7Z9F9whZpEtmi1st0ZYbz\nam2LZXa/uPQzF/mnwbucHTSu8RR7RW4nMjoG/o2MS2OOd4cmApR2kV5a1blr\nWJeah2KsRdEUjZ/IkKe+MSCFLGywp7rzwffNHPVtG/lITmNJ4T+WAN4BJYr6\nYbCt3xgupJfVp+J6aTh2+YFkuiaOVjpjbuFWl18rrCIM/Na/mhXeWzcClQiI\nnUHE9lSrZcZ4b7lW7n/nrC+7YVcpH49onngUh6gQjl58dBBSVH+j005Bij9N\n62m/qI74dBvwe2TA6tNVWX76bZa21qjNoX1FzKji5JHvN1PCm84m56kWkM0Z\nUsVXywS/jkG/JPXsm8fJSllmhjrZX8g7IgRsK5/E4EDvd29+iwUVEb8eo4B2\nREIL\r\n=Gi3+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7875+WbLjBaG7M5i6JxtY6TMVV61ZlG0aEG8DO2ezPAiEA+iw1B4GUecvS/OA4Tg4ycstwKv8qzPlUGC2I9GSlLog="}],"size":2811,"noattachment":false,"key":"/it-multipart/-/it-multipart-1.0.0.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.0_1568269159022_0.31563641374669893"},"_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":1568269159157,"_cnpm_publish_time":1568269159157,"dist-tags":{"latest":"4.0.0"}}