Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs read file to array

const fs = require('fs');
const data = fs.readFileSync('file.txt', 'utf8').split('
'); //use .split() to chose a character to define where a new piece of data starts
 
PREVIOUS NEXT
Tagged: #nodejs #read #file #array
ADD COMMENT
Topic
Name
3+1 =