Re: [JSMentors] accessing global variable in a callback

2011-03-21 Thread Poetro
In Node.js the global object is called `global`, but you rarely need to interact with it, and in most cases you shouldn't. If you need something that is modularized make your own module, and include it with the `require` function. And on initialization of that module you may send it your from the m

Re: [JSMentors] accessing global variable in a callback

2011-03-21 Thread Peter van der Zee
On Sun, Mar 20, 2011 at 9:26 PM, tim perkis wrote: > Is there something I'm not understanding about global scope? > Maybe the fact that there is none :) Not in node in the classic sense anyways. I guess I would "monkey patch" your own object for debugging and just assign whatever you want to se

[JSMentors] accessing global variable in a callback

2011-03-21 Thread tim perkis
I'm misunderstanding something about global scope in javascript, and node.js in particular. I have a global data structure which drives my entire (small) node.js app. For debugging, I wanted to be able to send a message to the app that triggers dumping this struct to the console. code is like: v