Skip to content

Instantly share code, notes, and snippets.

@fstoerkle
Created August 29, 2017 08:47
Show Gist options
  • Save fstoerkle/5db42b30d553f791d67ff81f8338bccc to your computer and use it in GitHub Desktop.
Save fstoerkle/5db42b30d553f791d67ff81f8338bccc to your computer and use it in GitHub Desktop.
global
> 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
'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