Node.js fs read sync text file and split by lines

Description

Node.js fs read sync text file and split by lines



var fs=require('fs'); 

var buffer=fs.readFileSync('/home/hector/node/archprog3.txt')

var str=buffer.toString();

var splt=str.split("\n");

console.log(8);/*  w  ww  . j ava 2 s .c  om*/



PreviousNext

Related