Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created September 15, 2012 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmalecki/3729371 to your computer and use it in GitHub Desktop.
Save mmalecki/3729371 to your computer and use it in GitHub Desktop.
How `module._extensions` works
var module = require('module');
module._extensions['.ext'] = function (module, filepath) {
module.exports = 42;
};
console.dir(require('./whatever.ext'));
whatever really
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment