Skip to content

Instantly share code, notes, and snippets.

@raisch
Created October 1, 2013 23:41
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 raisch/6786930 to your computer and use it in GitHub Desktop.
Save raisch/6786930 to your computer and use it in GitHub Desktop.
Node require.cache tomfoolery
module.exports={
foo:true,
bar:false
};
var Config=require('Config');
console.log(Config.foo);
Config.foo=false;
console.log(Config.foo);
delete require.cache[require.resolve('Config')];
Config=require('Config');
console.log(Config.foo);
@raisch
Copy link
Author

raisch commented Oct 1, 2013

Prints:

true
false
true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment