Answers for "node.js read file with fs"

16

read file node

// load fs
const fs = require("fs");
// read the file
const content = fs.readFileSync("./my_file.txt");
// print it
console.log(content.toString());
Posted by: Guest on October-11-2020
2

node.js import fs

import fs from "fs";
Posted by: Guest on September-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language