Skip to content

Instantly share code, notes, and snippets.

@akoenig
Created March 3, 2012 20:49
Show Gist options
  • Save akoenig/1968154 to your computer and use it in GitHub Desktop.
Save akoenig/1968154 to your computer and use it in GitHub Desktop.
node.js talk - file reader
/*
* FileReader with node.js
*
* Author: André König ([email protected])
*
*/
"use strict";
var fs = require('fs');
fs.readFile('hallo.txt', 'utf8', function (err, data) {
if (err) {
console.log('Ouch ... ' + err);
return;
}
console.log('Inhalt: \n');
console.log(data);
});
console.log('##### Lese die Datei "hallo.txt" aus');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment