http.createServer(async (req, res) => { if (req.method === 'POST' && req.headers['content-type']) { forawait (constpartofmultipart(req)) { console.log(`part with HTTP headers ${part.headers}`)
// nb. part.body must be consumed before the next part is emitted forawait (constchunkofpart.body) { console.log(`part with content ${part.name} contents:`, chunk.toString()) } }
Allows iterating over multipart messages found in a HTTP request/
Example