Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

import local js file node

//Main Code
const lib = require("./otherfile");
//otherfile.js
module.exports = { veryimportantvar };
//Main Code
console.log(lib) //Returns the contents of veryimportantvar
 
PREVIOUS NEXT
Tagged: #import #local #js #file #node
ADD COMMENT
Topic
Name
4+9 =