You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
508 B
JavaScript
21 lines
508 B
JavaScript
9 years ago
|
var Fs = require("fs");
|
||
|
|
||
|
var message = function(file, msg) {
|
||
|
file.write(msg+"\n");
|
||
|
}
|
||
|
|
||
|
var create = module.exports.create = function(filePath, backingStore) {
|
||
|
|
||
|
var file = Fs.createWriteStream(filePath, {flags: 'a+'});
|
||
|
|
||
|
return {
|
||
|
message: function(channel, msg, callback) {
|
||
|
message(file, msg);
|
||
|
backingStore.message(channel, msg, callback);
|
||
|
},
|
||
|
getMessages: backingStore.getMessages
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|