async-busboy-plus
v0.7.1
Published
Promise based multipart form parser
Downloads
3
Maintainers
Readme
Promise Based Multipart Form Parser
forked from 'async-busboy'
add complete method to delete tmpfile
add tmpdir option to select where to cache
Examples
Async/Await (using temp files)
import asyncBusboy from 'async-busboy-plus';
// Koa 2 middleware
async function(ctx, next) {
const {files, fields, complete} = await asyncBusboy(ctx.req, {
// default to os.tmpdir
tmpdir: '/tmp'
});
// Make some validation on the fields before upload to S3
if ( checkFiles(fields) ) {
files.map(uploadFilesToS3)
} else {
return 'error';
}
complete()
}