src/server/factory.js
function getCallerDirname() {
  var orig = Error.prepareStackTrace;
  Error.prepareStackTrace = function(_, stack){ return stack; };
  var err = new Error();
  Error.captureStackTrace(err, arguments.callee);
  var stack = err.stack;
  Error.prepareStackTrace = orig;
  var requester = stack[2].getFileName();

  return path.dirname(requester);
}
function getCallerDirname() {
  var orig = Error.prepareStackTrace;
  Error.prepareStackTrace = function(_, stack){ return stack; };
  var err = new Error();
  Error.captureStackTrace(err, arguments.callee);
  var stack = err.stack;
  Error.prepareStackTrace = orig;
  var requester = stack[2].getFileName();

  return path.dirname(requester);
}
function getCallerDirname ( ) { var orig = Error . prepareStackTrace ; Error . prepareStackTrace = function ( _ , stack ) { return stack ; } ; var err = new Error ( ) ; Error . captureStackTrace ( err , arguments . callee ) ; var stack = err . stack ; Error . prepareStackTrace = orig ; var requester = stack [ 2 ] . getFileName ( ) ; return path . dirname ( requester ) ; }
Gets the dirname of the caller function that is calling this method.
@return {String}  Absolute path to the caller's directory.
Gets the dirname of the caller function that is calling this method .