Skip to content

Instantly share code, notes, and snippets.

@plato-cambrian
Created December 11, 2014 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plato-cambrian/5e4c709de08ccda6ef3b to your computer and use it in GitHub Desktop.
Save plato-cambrian/5e4c709de08ccda6ef3b to your computer and use it in GitHub Desktop.
// foo.js
var demo = "foobar";
require('./baz.js')();
// baz.js
module.exports = function(){
console.log(demo)
}
// console
$ node foo.js
c:\dev\src\foo\baz.js:2
console.log(demo)
^
ReferenceError: demo is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment