I asked here: node.js require inheritance?(我在这里问: node.js是否需要继承?)
and was told that I can set variables to the global scope by leaving out the var.(有人告诉我可以通过省略var将变量设置为全局范围。)
This does not work for me.(这对我不起作用。)
ie:(即:)
_ = require('underscore');
Does not make the _ available on required files.(不能使_在必需文件上可用。) I can set with express's app.set
and have it available elsewhere though.(我可以使用express的app.set
进行设置,但是可以在其他地方使用。)
Can somebody confirm that this is supposed to work?(有人可以确认这应该起作用吗?) Thanks.(谢谢。)
ask by Harry translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…