require is not a global, it's a free var.  (You missed exports,
__filename, __dirname, and module, if you're counting free vars.)

process and Buffer are intentionally global.  There is one process,
and Buffer is a top-level class that's used all over.  (In node-speak,
it's somewhat like String or Array.)

GLOBAL and root are relics, but we're not removing them.  In modules
"this" is the exports object, not the global root, for historical
reasons.

Is the presence of any of these causing harm for you?  (Apart from
offending your refined esthetic sensibilities?)

It seems like the only effect of removing them is that we'd break
"bad" programs (which are only "bad" because they break The Rule by
referring to a global variable).  But that is just schadenfreude, it
is not the Node Way.


On Wed, Jul 11, 2012 at 8:40 AM, Joran Greef <jo...@ronomon.com> wrote:
> I noticed that running an empty node interpreter always provides these
> global variables:
>
> require
> global
> process
> GLOBAL
> root
>
> "this", "global", "GLOBAL", and "root" are redundant?
>
> Is there any way to bring "process" in manually using "require('process')"?

Reply via email to