Yeoman generator function in global namespace

In yo nodejs module, under bin directory, there is a file yo. On line 47 of that file there is this line of code:

var env = require("yeoman-generator")()

It seems that yeoman-generator is global function, which is called and the result is assigned to env variable. I don't see where and how is that function exported to a global namespace ?

Can someone help ?

Thank you

require() is how you require other Node modules. In this instance the dependency yeoman-generator is require()'d.