Node JS

5 Ways To Read Files In NodeJS (To String, Line-by-Line, Array)

Welcome to a quick tutorial and examples on how to read files in NodeJS. Reading files, just how difficult can it be? Well, brace yourselves. It’s not that straightforward apparently. The common ways to read files in NodeJS are: To read the entire file into a string asynchronously – require(“fs”).readFile(“FILE.TXT”, “utf8”, (err, data) => { […]

5 Ways To Read Files In NodeJS (To String, Line-by-Line, Array) Read More »