Skip to content

Parse stream of multipart into sub streams per part

License

Notifications You must be signed in to change notification settings

anzerr/form.pipe

Repository files navigation

Intro

GitHub Actions status | linter GitHub Actions status | publish GitHub Actions status | test

Parse stream of multipart into sub streams per part

Install

npm install --save git+https://[email protected]/anzerr/form.pipe.git

Example

const fs = require('fs'),
	path = require('path'),
	FormPipe = require('form.pipe');

fs.createReadStream('./test/out.dump').pipe(new FormPipe()).on('data', (file) => {
	file.stream.pipe(fs.createWriteStream(path.join(__dirname, file.filename))).on('close', () => {
		console.log(file.name, 'done');
	});
});