Created
February 10, 2015 07:26
-
-
Save nrafter/a9724a97a2cfe4ae7686 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given a file name, pass it to the proper extension handler. | |
Module.prototype.load = function(filename) { | |
debug('load ' + JSON.stringify(filename) + | |
' for module ' + JSON.stringify(this.id)); | |
assert(!this.loaded); | |
this.filename = filename; | |
this.paths = Module._nodeModulePaths(path.dirname(filename)); | |
var extension = path.extname(filename) || '.js'; | |
if (!Module._extensions[extension]) extension = '.js'; | |
Module._extensions[extension](this, filename); | |
this.loaded = true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment