koajs / koa-body

koa body parser middleware
MIT License
941 stars 130 forks source link

Expose "progress" and other Formidable events #107

Open nicbarker opened 5 years ago

nicbarker commented 5 years ago

Hi, Thanks for the great small module. I need to monitor the progress of file uploads from the node side. Formidable has this capability in a number of ways including the "progress" event. At the moment koa-body allows you to pass through the onFileBegin event to formidable: https://github.com/dlau/koa-body/blob/04d8afa715e8f59c8db5103491d14df4dca2bf38/index.js#L168 However there's no way to hook into the 'progress' event (among others) It would be great if all the 'on' formidable events could be exposed.

MarkHerhold commented 5 years ago

I'd be willing to accept a PR for this so long as events are prefixed with formidable so as not to cause confusion with progress say from a JSON POST.