var root = process.cwd() + '/';

if you run the  /home/myuser/app.js then the root will be /home/myuser/

you may also share this as global

var root = global.root = process.cwd() + '/';

and then get it from any required file as global.root, this is what i'm 
doing in my framework <https://github.com/Shogun147/Katana>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to