Quantcast
Channel: node.js require files globally - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by FSeidl for node.js require files globally

$
0
0

You should require the module inside the module where you need it. In your case the line var variable = require(folder/file); should be inside folder2/file2 and not your init.js file.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>