-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Description
Trying to add a ES6 Promise version of the .mv function.
Here's the draft:
mvPromise: function(path) {
return new Promise((resolve, reject) => {
let fstream = fs.createWriteStream(path);
streamifier.createReadStream(buf).pipe(fstream);
fstream.on('error', function(error) {
reject(error);
});
fstream.on('close', function() {
resolve();
});
});
}
This should be appended after the .vm
definition in let newFile
.
Any suggestions? If this looks good, I'll create a pull request with a test.
Metadata
Metadata
Assignees
Labels
No labels