Created
October 1, 2013 23:41
-
-
Save raisch/6786930 to your computer and use it in GitHub Desktop.
Node require.cache tomfoolery
This file contains 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
module.exports={ | |
foo:true, | |
bar:false | |
}; |
This file contains 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
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prints: