This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |