-
-
Save NguyenTrungTin/91fb2eee782e89553d208dc55c92374a to your computer and use it in GitHub Desktop.
Get root path of node.js application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment