var multipart = require('/multipart.js'); +var stream = new multipart.Stream(options); +var parts = {}; + +stream.addListener('part', function (part) { + var name = part.headers['Content-Disposition'].name; + var buffer = ''; + + part.addListener('body', function(chunk) { + buffer = buffer + chunk; + }); + + part.addListener('complete', function() { + parts[name] = buffer; + }); +}); + +stream.addListener('complete', function() { + // The parts object now contains all parts and data +});+