Tuesday 21 May 2019

How can you require a node package in a seperate .js file ?

For some reason I can't find anything online - I am new to node and electron. I have a main.js file and an init.js file. I want to use require('fs') in init.js. but it fails with require is not defined. It works in main.js but not in init.js.​Any advice ?

Submitted May 21, 2019 at 04:46PM by iwanttodiequick

No comments:

Post a Comment