node.js - shared variable between to node modules -
i've issue. need generate random number in 1 node module, , use in other module.
how can share between modules without regenerate each require do
thanks
if understand correctly want generate random number once , use across modules right? simple. export random number module generated , require in module want use from. here code
exports.myrandomnumber = 112938; var number = require("./myfile").myrandomnumber;
Comments
Post a Comment