Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created October 1, 2013 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piscisaureus/6783332 to your computer and use it in GitHub Desktop.
Save piscisaureus/6783332 to your computer and use it in GitHub Desktop.
task.create(function ConcatTwoFilesAndThenSomeTask() {
fs.readFile('some/template', 'utf8', function(err, file1) {
if (err) throw err;
fs.readFile('something/else', 'utf8', function(err, file2) {
if (err) throw err;
var data = file1 + '--' + file2;
data = data.replace(/foo/g, 'bar');
return data;
});
});
}).setCallback(function(err, result) {
if (err)
throw err;
// Do something with the result.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment