Created
August 29, 2017 08:47
-
-
Save fstoerkle/5db42b30d553f791d67ff81f8338bccc to your computer and use it in GitHub Desktop.
global
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> const l = require('./someModule') | |
> l() | |
global.TEST undefined | |
ReferenceError: TEST is not defined | |
at module.exports | |
... | |
> global.TEST = 'foo' | |
> l() | |
global.TEST foo | |
TEST foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = () => { | |
console.log('global.TEST', global.TEST); | |
console.log(' TEST', TEST); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment