Rozbot/lib/promise/appendFile.js
2016-07-11 23:24:15 -04:00

13 lines
288 B
JavaScript

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);
}
});
});
}