Skip to content

Instantly share code, notes, and snippets.

@labra
Created October 20, 2016 18:52
Show Gist options
  • Save labra/18ec5548cfa1d80cd6300c6fadfe7f3a to your computer and use it in GitHub Desktop.
Save labra/18ec5548cfa1d80cd6300c6fadfe7f3a to your computer and use it in GitHub Desktop.
var fs = require('fs');
fs.readdir("listados/", function(err, filenames) {
if (err) throw err;
filenames.forEach(function(filename) {
fs.readFile("listados/" + filename, 'utf-8', function(err, content) {
if (err) throw err;
console.log("Fichero: " + filename)
console.log(content)
});
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment