NguyenTrungTin
4/16/2019 - 4:57 AM

Get root path of node.js application

Get root path of node.js application

var path = require('path');

module.exports = (function () {
  return path.dirname(require.main.filename || process.mainModule.filename);
})();

// Example of usage:
var rootPath = require('rootPath'); // In root will be absolute path to your application