__ __ __
.--------.--.--.| | |_|__|.-----.---.-.----.-----.-----.----.
| | | || | _| || _ | _ | _|__ --| -__| _|
|__|__|__|_____||__|____|__|| __|___._|__| |_____|_____|__|
|__|
A streams2 compatible multipart-form parser. Hacked from formidable.
Why
Formidable currently doesn't work with node >= 9.4. Also a good excuse to learn streams2.
How
The module exports a class Multiparser
which inherits from Stream.Writable
. Http request streams can be piped to instances which will emit 'part'
events (essentially instances of Stream.PassThrough
) that can then be piped around as needed (to file, s3, etc). Backpressure from parts' destinations are magically transmitted back to the Multiparser's source.
Install
npm install multiparser
Usage
The code below is pretty much straight from example/http.js
var fs = var Multiparser = var http = var updir = '/tmp/' http
License
MIT