Skip to content

Instantly share code, notes, and snippets.

Last active February 23, 2017 15:18
What would you like to do?
const Module = require(‘module’); // this is a module from Node.js core library
Const load = Module._load;
Module._load = function (request, parent) {
const mod = load.apply(this, arguments); // load the module with the original method
// add hooking logic here
keepTrackOfImport(mod, request, parent);
return mod;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment