Pechkin (the library) was born out of a personal dissatisfaction with Multer: a project at my previous job had complex file upload functionality with fields and lots of files mixed together, and to perform even the most basic validation on the fields, we had to wait until Multer processes & saves all the files, to get access to the req.body. Needless to say, that was painfully slow.<p>As I was trying to rewrite the file upload functionality in Busboy, I realized how events aren't a good mental model for `multipart/form-data` requests, and async iterators were (IMO) much more suitable for the task.<p>And so, this library was born.<p>API TL;DR:<p>- No temporary files are created, files are not loaded in memory.
- No need to provide storage engines, file handlers, event listeners, etc.
- The main (and only) function returns a Promise that resolves when all fields are parsed, and the first file is encountered (or the request ended).
- The promise contains a populated `fields` object, and a `files` `AsyncIterator/AsyncIterable`.
- Asynchronously iterate over the files using the `for-await-of` loop or using the `next()` method.<p>I'd appreciate for any critique and feedback on the API & the documentation :)