{"name":"it-multipart","version":"2.0.0","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":{"formidable":"^1.2.2","it-pushable":"^1.4.2"},"devDependencies":{"@types/formidable":"^1.2.1","ava":"^3.12.1","form-data":"^3.0.0","node-fetch":"^2.6.0","nyc":"^15.1.0","standard":"^16.0.3","typescript":"^4.0.2"},"types":"dist/index.d.ts","gitHead":"72c6be7698d2f7e85941eb3c6f61d350402a929e","_id":"it-multipart@2.0.0","_nodeVersion":"15.13.0","_npmVersion":"lerna/3.22.1/node@v15.13.0+x64 (darwin)","dist":{"integrity":"sha512-GOHX/ar1FQAurSlLoQaKRE3kxQryWsWg7zJ8kePao5D0ukapMj7W1rB6HKmESbDBoxYSoDll2QAO/cjC3jgahw==","shasum":"89aceef7fa156e68758e40101ca2a874042321ee","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-2.0.0.tgz","fileCount":7,"unpackedSize":7649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJggwdTCRA9TVsSAnZWagAAKyIP/il+5DcBOw4n8HuTjSAj\n1N8XEcwR5q4uezfxdZSj3g0k2+49WMVoJyjVoWaqNGG0lpLgvPBZGIFMcSl9\n7NHDrzsapr55imRqmOPbck/8VAlaw41ILu6lgEHgDugF4n8XC2J2njroVZpm\nEH2twkbV8X2dtnBuaCEqm+hqXhxz4sZ5hbKolV1n8mVvDX0xmFNIjkjH40hf\nMBGxmZYxC5/bnnY8cJ9aGgwPhwUTVKuZqM5RGJXdI0oVcLhTPerKDpMVaT9I\nQgm0f7H0uFPoL/etwAGSm4uXEI4WE2kYo5UgD5Lkb/2dGh8GF17ynFf6IXvE\nNtDxT9Yhi82qRHPKmWcSVctv+ZGFl4/D5LYHmcoeQCu2MT5u2B6mJ2lFQJBM\nZFi/4OVTovDO+9Ggt56vA8Wmci14HOgX/2f21/TD/ybE55Mv4TeDGqAb7yGM\n0G6n0l9nHzYGq6O/fZkv2K1pqekPEdFSaJ1ennoppK8a5SykUtBDhAqgeoX5\nsPoDwX9m81Zt08YitehlvRpr28sYMPHfCIsq9wE4YPKjS3z9l34AX1XfWCoT\n5E+w9Zno8cHe/b548/bVTlf8rP5A7qkNd+zbkNJvHDB5CZ7aV0iGQ6r/iC9Q\nZENsfYxzlXqmhslxImMiBIhQ1wUi+6/1o+9yZ2Wi0DJ4OS7f6ujfPHlZOKX/\nrPWW\r\n=koYK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKPiJPidbh2cxo7iAtpaDegr0N+PSVxAVmq3aa4it+OQIhALREk3qihniGexsQStC5zWbTcautLIYL023JCPK7vdbs"}],"size":2956,"noattachment":false,"key":"/it-multipart/-/it-multipart-2.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/it-multipart_2.0.0_1619199826853_0.037853773521496104"},"_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":1619199826993,"_cnpm_publish_time":1619199826993,"dist-tags":{"latest":"4.0.0"}}