{"name":"it-multipart","version":"3.0.8","description":"Async iterable http multipart message parser","author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/achingbrain/it/tree/main/packages/it-multipart#readme","repository":{"type":"git","url":"git+https://github.com/achingbrain/it.git"},"bugs":{"url":"https://github.com/achingbrain/it/issues"},"publishConfig":{"access":"public","provenance":true},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"scripts":{"build":"aegir build","lint":"aegir lint","dep-check":"aegir dep-check","clean":"aegir clean","test":"aegir test -t node","test:node":"aegir test -t node --cov"},"dependencies":{"formidable":"^3.5.1","it-pushable":"^3.2.3"},"devDependencies":{"@types/formidable":"^3.4.5","aegir":"^42.2.5","form-data":"^4.0.0","it-drain":"^3.0.0","node-fetch":"^3.3.2","uint8arrays":"^5.0.3"},"browser":{"http":false,"formidable":false},"_id":"it-multipart@3.0.8","gitHead":"9db0788d0f744942b22a71b96f94b22b7f45de3b","_nodeVersion":"20.12.2","_npmVersion":"10.5.2","dist":{"integrity":"sha512-GpKKDApo31oU58CpThBFbOjmMFhjjnr/t2qmMriQak+Xg5NiT4P4x6qA0s1Ai3npzZzkz+0bDA1VDLE9wc+Z7w==","shasum":"029177cbf274f5af7d84db2d030f5d6ef44e7563","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-3.0.8.tgz","fileCount":10,"unpackedSize":14986,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/it-multipart@3.0.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClP07qLfYWgJ+SqPAuyIJ9qSai1M24TbcZvngb6mD+qQIgBqIfSzkF2QbIFUIoxYzlKWs+bNPlyetSXna5WOLcfpk="}],"size":5068,"noattachment":false,"key":"/it-multipart/-/it-multipart-3.0.8.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_3.0.8_1713977559207_0.03531630429124499"},"_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":1713977559370,"_cnpm_publish_time":1713977559370,"dist-tags":{"latest":"4.0.0"}}