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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -