Skip to content

Instantly share code, notes, and snippets.

View sebasalvarado's full-sized avatar

Sebastian Alvarado sebasalvarado

  • @valarico
  • Toronto, Canada
View GitHub Profile
@sebasalvarado
sebasalvarado / read.js
Last active February 3, 2018 21:00
Leer una file JSON
const fs = require("fs");
// Asumiendo la file se llama data.json
let data;
fs.readFile("data.json", "utf8", (err, fileData) => {
if (err) {
throw new Error("Error leyendo la file");
}
data = JSON.parse(fileData);
// La variable data tiene tu file