Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

read txt file in node js

var fs = require('fs');

fs.readFile('my-file.txt', 'utf8', function(err, data) {
    if (err) throw err;
    console.log(data);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery add checked attribute 
Javascript :: regex check for numbers only js 
Javascript :: how to randomly sort an array javascript 
Javascript :: javascript element by class 
Javascript :: javascript replace newline 
Javascript :: jQuery and changing the input field type 
Javascript :: reload page jquery timer 
Javascript :: content of page fully loaded javascript 
Javascript :: javascript window resize event 
Javascript :: pick random string from array javascript 
Javascript :: react native flatlist hide scrollbar 
Javascript :: how to get mouse x and y in javascript 
Javascript :: javascript remove spaces at the beginning of the end of the string 
Javascript :: split into sentences at any punctuation javascript 
Javascript :: local storage check if key exists 
Javascript :: one year ago javascript date 
Javascript :: gitignore all node_modules 
Javascript :: one line uuid 
Javascript :: emmet not working react js 
Javascript :: node write text to file 
Javascript :: E: Unable to locate package nodejs 
Javascript :: install react 
Javascript :: integer to roman javascript 
Javascript :: check if date time string is invalid date js 
Javascript :: validate Alphabet Letter js 
Javascript :: javascript indexOf object value in array 
Javascript :: sleep in react 
Javascript :: javascript replace spaces with nbsp 
Javascript :: javascript reverse a string 
Javascript :: synchronous ajax 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =