The compiler function was executed immediately when you require ./compiler. this function receive the dust object as param. In the browser case, the dust object is obtained with the getGlobal function but in nodejs we don't have access to the dust object. So I have assigned the compiler function to a variable, comp, and if dust is being executed from browser I call it but if dust is being executed in node, I return the function, so the server can call it with the dust object.