Skip to content

Commit

Permalink
Merge pull request #4 from pajtai/master
Browse files Browse the repository at this point in the history
Adding streamifier to make buffer into a stream - Closes #2
  • Loading branch information
richardgirges committed Apr 22, 2016
2 parents e8ee625 + a130015 commit aa22295
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions jslib/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
var busboy, fs;
var busboy, fs, streamifier;

busboy = require('connect-busboy');

fs = require('fs-extra');

streamifier = require('streamifier');

module.exports = function(options) {
options = options || {};
return function(req, res, next) {
Expand Down Expand Up @@ -37,7 +39,7 @@ module.exports = function(options) {
mv: function(path, callback) {
var fstream;
fstream = fs.createWriteStream(path);
this.data.pipe(fstream);
streamifier.createReadStream(buf).pipe(fstream);
fstream.on('error', function(error) {
return callback(error);
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "./jslib/index",
"dependencies": {
"connect-busboy": "0.0.2",
"fs-extra": "^0.22.1"
"fs-extra": "^0.22.1",
"streamifier": "^0.1.1"
},
"engines": {
"node": ">=0.8.0"
Expand Down

0 comments on commit aa22295

Please sign in to comment.