{"name":"it-multipart","version":"1.0.5","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 dist","check":"tsc --noEmit","build":"npm run build:types","build:types":"tsc --emitDeclarationOnly --declarationDir dist","prepublishOnly":"npm run build"},"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":"^3.12.1","form-data":"^3.0.0","node-fetch":"^2.6.0","nyc":"^15.1.0","standard":"^14.3.1","typescript":"^4.0.2"},"typesVersions":{"*":{"*":[".","dist/*"]}},"gitHead":"c3b92107f44c99ccbf3299827db45beaf2405c24","_id":"it-multipart@1.0.5","_nodeVersion":"12.16.1","_npmVersion":"lerna/3.22.1/node@v12.16.1+x64 (darwin)","dist":{"integrity":"sha512-HW0/ycdwqM1Xz1cwkBUwmU2HTxrJrUdVZBIgX5/fNzEjIgbnL3oZUysG2NeKNbIA0vt4wnqLK6fAps/nvQ0AbA==","shasum":"74191fd45fab2636349f6535d3edea3a17526e73","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-1.0.5.tgz","fileCount":7,"unpackedSize":12533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYNgrCRA9TVsSAnZWagAAg2oP/Rp7Pb1OKlO9NumschqL\nOSBnWMbju0t/E/KjqKZ1bhs/IEWtFSlh3JRIPpKkzvAp7/0+fpCGGuKWcBZZ\nA87GUbF32xWLHFP/DmlJqNsrMI3p4ZnD8zS/dqrzWygMV7kAmzfdzF4tj3oZ\nXlomiSCiR4fyYRIUsO0UOX8Z7I3xT+rKNy59uit2EJIlLSRqTklvEybkFRZ4\nQHjj8sZsnxw3q0edwFayOMkmB4gDlJqmRgvOWIsB+6sQuvaWCYv0uBoT02HI\n0UJeMV5zwQ82n03ahvv43xuQwZf2/v9uZTp2XW1Q4H1WvDi9CucTi+lbjO0C\nVz2MppL9x0DJYys29tLBkUyVxvvUSuG8KKLDI6K9EHldHw/AWHxWp/mlYk+a\nNFTGO2VE048O8EKmRlkvaqsKqcKqAzwVKDoUHGlAKpk22u6nq2EUWq8ofXZY\n8T+0Oq/MTFrN0igE6HleCXDMPN28divvwszC1I6jp7Ybvj0d4joAVh24+B3t\nqbh/AHkeyRYb2cytbxdMGU+vThaUrcpIu2tqUNwqqGTL0C5SWblFtmUCy0sh\npI+vnWt29OWPASSZdj/rxn0zudGsIjIeUWZ6+FrG9wMNiUIBrRM+Os2Wznoj\nfREcbb3JIxWGcPaSUHK8ezsxn4Ap4c9sjgFZ6QuNNQEqorirRGoRdhOLz8qk\n7dV9\r\n=Tgxl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpv0fhKP8X7PkFdIue+ChPjNPNUNmrXWdDV4OeTZMtIAiAjYJ3w/WapZ7tTxk15yWOW4OtIkEYtLa5T6hGS2PQgmQ=="}],"size":4380,"noattachment":false,"key":"/it-multipart/-/it-multipart-1.0.5.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.5_1600182314999_0.5877323478231329"},"_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":1600182315101,"_cnpm_publish_time":1600182315101,"dist-tags":{"latest":"4.0.0"}}