Skip to content

Connect middleware for busboy that abstracts you from all that boilerplate code.

License

Notifications You must be signed in to change notification settings

andrezzoid/connect-busbuddy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

Connect middleware for busboy.

Requirements

Install

npm install connect-busbuddy

Example

var busbuddy = require('connect-busbuddy');

// default options, no immediate parsing
app.use(busbuddy());
// ...
app.use(function(req, res) {
    var prop = req.body['my-input'];
    
    var file = req.files['my-file'].file;
    var filename = req.files['my-file'].filename;
	var dst = fs.createWriteStream('./uploads/' + filename);
	file.pipe(dst);
});
// any valid Busboy options can be passed in also
app.use(busboy({
  highWaterMark: 2 * 1024 * 1024,
  limits: {
    fileSize: 10 * 1024 * 1024
  }
}));

Licence

MIT - https://github.com/andrezzoid/connect-busbuddy/blob/master/LICENSE

About

Connect middleware for busboy that abstracts you from all that boilerplate code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%