Answers for "nodejs read file to array"

0

nodejs read file to array

const fs = require('fs');
const data = fs.readFileSync('file.txt', 'utf8').split('\n'); //use .split() to chose a character to define where a new piece of data starts
Posted by: Guest on January-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language