Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 36 lines (31 sloc) 0.814 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#!/usr/bin/env node

var Module = require('module').Module,
    __load = Module._load,
    packages = {};

//
// Monkey punch `Module._load()` to observe the names
// of packages as they are loaded.
//
Module._load = function (name, parent) {
  name = /^[./]/.test(name) ? Module._resolveFilename(name, parent)[1] : name;
  console.log('__!load::' + name);
  return __load.apply(Module, arguments);
}

try {

  process.nextTick(function () {
    process.exit(0);
  });
  //require(process.argv[2],null,true);
  Module._load(process.argv[2],null,true)
}
catch (ex) {
  //
  // Log errors and attempt to log as many packages as we can.
  //
  var eStr = '' + (ex
    ? (ex.stack ? ex.stack : ex)
    : 'falsey error: ' + ex)

  eStr.split('\n').forEach(function (line) {
    console.error('__!err::' + line);
  });
}
Something went wrong with that request. Please try again.