code to get to root path from current path in javascript code example Example: nodejs fs root folder path global.__basedir = __dirname;