{"name":"it-multipart","version":"1.0.3","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":"faf5c823bffd25e888b9c0353aed30efa5cf508d","_id":"it-multipart@1.0.3","_nodeVersion":"13.13.0","_npmVersion":"lerna/3.19.0/node@v13.13.0+x64 (darwin)","dist":{"integrity":"sha512-8PSjOl5OSx2fCbBJ73uV4ZVMY0Q/yCQrWHNk6XYXYDwByH5rnSBYEyuSSiOM2grDLY39atybbKTbMi3GWEbACA==","shasum":"faae7479541ae6302f5728a36015dd362f7dec57","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-1.0.3.tgz","fileCount":4,"unpackedSize":8586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepqc2CRA9TVsSAnZWagAA8EAP/2iO++psnIPd0cg/b2Cf\ngKTSCvQup5XjJaUcDBi5TTUaTlc2KECe3ZFmwjlU+joMI6gKuse3CxiiuD8a\nmLs9YvX3cl+nNtd2+l/Eubp9Hv6DCIKP6ZFcTiiCUpJIiC3BlAdmH8heDghA\n1VPlddAh1pb21aYvUMY37SNkIhMZ+c0AYh+1rRdNGyJJ/hDHBuVPfA2KjwJx\nmz0WQ0DEwrH3K9ZeFAckCe+GM4lzrjSsQEkEnNSQQ8uhh+McTUC7OwCX8TcN\nqNnNso1MEWa9Hg39Q3B4I9UGLRVK2VDQ8xp0jqUXw+/1XE7/KJxyY6Url3Zq\nrDjNOF969Gc32n8+B5yeyjGWnzB+H4Fg2JD+Zc85Jg4/Vg4vlCrQfiKD2wCy\ne34sq3wepv4XR6Q2o9/JAgeJ6K8N2yRwRUm2x7qqRyFhL+g6ocj4dGRPoyeO\nInSkj7yyWsWK246GTleRWVoQ/53KY0iG7FgDBjM+zqzRfDG6zfdp3oOz6++F\nn+6aPyn3BQYvFShqR0oPXe0mzpMo8RiOa7MJwHPc33UbD6yTvSzjaChC79qo\nl8v0PyBLDRR2GaGYVwJpMEF+oKgqpLvac50ZFT2jl2XZnloSfZS077xoxRIY\n8fxL4HulEDTNsFwbtlQ6FPViwkV60CZlKv7c4bJ8tODQ5h6XyobDzdJntFeG\nhv+l\r\n=YIz2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyPExRecTtwv1sMEKhvuVe2xQpn8g6EJoRj20zbSL/bAIgQieBWAi2MVKXyZ2mMVWh5n54Ftch5MqdO2xgv26fBMw="}],"size":3046,"noattachment":false,"key":"/it-multipart/-/it-multipart-1.0.3.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.3_1587980086206_0.029047457529537635"},"_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":1587980086365,"_cnpm_publish_time":1587980086365,"dist-tags":{"latest":"4.0.0"}}