Repo to showcase that node.js suffers from global leaks just like the browser does - was a surprise to me
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Node Globals

This repo showcases hat if you forget a var keyword in Node.js, it'll leak the variable into a global variable, accessible from other files and modules too! Just like it would in the browser!


Why did I even bother doing this? I write CoffeeScript, which ensures all variables are locally scoped, so I never realised this behavour actually occurs within node, so was surprised when it did. Perhaps my fault? Maybe. But at least, using CoffeeScript means I never have to worry about this, perhaps time to give CoffeeScript a go?


node one.js