Todo.txt-Enyo/srv/WriteFileAssistant.js
2012-03-06 14:32:49 -05:00

11 lines
No EOL
339 B
JavaScript

var WriteFileAssistant = function() {
}
WriteFileAssistant.prototype.run = function(future) {
var fs = IMPORTS.require("fs");
var path = this.controller.args.path
var content = this.controller.args.content
fs.writeFile(path, content, 'utf8', function(err) { future.result = { path: path, bytes: content.length, error: err }; });
}