Skip to content

Instantly share code, notes, and snippets.

@eladb
Created September 1, 2012 08:27
Show Gist options
  • Save eladb/3567201 to your computer and use it in GitHub Desktop.
Save eladb/3567201 to your computer and use it in GitHub Desktop.
Who calls `path.exists`?
#!/usr/bin/env node
function trace(base) {
return function() {
console.log('called at:', new Error().stack.split('\n')[2].trim());
return base.apply(this, arguments);
};
}
var path = require('path');
path.exists = trace(path.exists);
path.existsSync = trace(path.existsSync);
@eladb
Copy link
Author

eladb commented Sep 1, 2012

Put this at the beginning of your node app's index file and you should see the call site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment