Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node load file

const fs = require("fs");

// __dirname means relative to script. Use "./data.txt" if you want it relative to execution path.
fs.readFile(__dirname + "/data.txt", (error, data) => {
    if(error) {
        throw error;
    }
    console.log(data.toString());
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery trim 
Javascript :: javascript replace string 
Javascript :: random light color js 
Javascript :: orthographic camera three js 
Javascript :: An accessor cannot be declared in an ambient context. 
Javascript :: es6 get value by key 
Javascript :: : not foundram Files/nodejs/npm: 3: 
Javascript :: toobject() javascript 
Javascript :: unexpected token. did you mean `{'}` or `>`? react 
Javascript :: mysql json change key 
Javascript :: id of other schema type mongoose 
Javascript :: javascript get first letter of each word 
Javascript :: random hexadecimal character js 
Javascript :: chart js y axis integer 
Javascript :: H. Nazmul 
Javascript :: get last item in map javascript 
Javascript :: .style.display 
Javascript :: location.reload sweetalert 
Javascript :: How to show confirm message before delete using jquery 
Javascript :: javascript call function on click give element id 
Javascript :: query selector by href 
Javascript :: moment get month name 
Javascript :: javascript check date greater than today 
Javascript :: fetch json file 
Javascript :: js redirect page 
Javascript :: get a element using name in jquery 
Javascript :: js check if string is integer 
Javascript :: how to create click function in javascript 
Javascript :: inner content 
Javascript :: pick random from array 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =