Rozbot/lib/promise/appendFile.js

14 lines
288 B
JavaScript
Raw Normal View History

2016-07-11 23:24:15 -04:00
var fs = require('fs');
var promise = require('promise-polyfill');
module.exports = function(file, data) {
return new promise(function(resolve, reject) {
fs.appendFile(file, data + "\n", function(error) {
if (error) {
console.log(error);
//reject(error);
}
});
});
}