It's preferable don't have such nested function. Because we're in a commonjs environment, you can have functions locals to the module, that are never exported. So, generally speaking, just declare such functions as module level functions, and use them.