{"name":"it-multipart","version":"3.0.11","author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"Apache-2.0 OR MIT","_id":"it-multipart@3.0.11","maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"homepage":"https://github.com/achingbrain/it/tree/main/packages/it-multipart#readme","bugs":{"url":"https://github.com/achingbrain/it/issues"},"dist":{"shasum":"f9470e3c4b735f7b99e2df883655aa39d2ae644d","tarball":"http://registry-npm.ywwl.com/it-multipart/download/it-multipart-3.0.11.tgz","fileCount":9,"integrity":"sha512-p7L0v0MP0ykZFWXwUBWtrItRyFBoTph4OixmTkmhAk1AZxYuQ6ewpF9xZkqpx55EiVbeWl9WKMGW2mNzzFizsQ==","signatures":[{"sig":"MEUCIBYFfI423a+JX0r8rEyTJXWb2finp2S0/PiNbLBdfGBgAiEApxpELlQjRcYjAWerr+VaE2Iyy7S/bCkSPgsl80aFXNw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/it-multipart@3.0.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36851,"size":10978,"noattachment":false,"key":"/it-multipart/-/it-multipart-3.0.11.tgz"},"type":"module","types":"./dist/src/index.d.ts","browser":{"http":false,"formidable":false},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"1397a46af9ef6eda0a51103e4fd259f4ab6a3f1d","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"]}]],"branches":["main"]},"scripts":{"lint":"aegir lint","test":"aegir test -t node","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"repository":{"url":"git+https://github.com/achingbrain/it.git","type":"git"},"_npmVersion":"10.9.2","description":"Async iterable http multipart message parser","directories":{},"_nodeVersion":"22.15.0","dependencies":{"formidable":"^3.5.4","it-pushable":"^3.2.3"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^46.0.1","it-drain":"^3.0.0","form-data":"^4.0.2","node-fetch":"^3.3.2","uint8arrays":"^5.1.0","@types/formidable":"^3.4.5"},"_npmOperationalInternal":{"tmp":"tmp/it-multipart_3.0.11_1747120645577_0.5055695572117058","host":"s3://npm-registry-packages-npm-production"},"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":1747120645767,"_cnpm_publish_time":1747120645767,"dist-tags":{"latest":"4.0.0"}}