relative path - Root folder of Node.JS application -


i have node.js application, , folder structure below.

/root     /libs     /jobs         /workers     app.js 

upon launching, app.js kick off serial of scripts in /jobs folder in child processes. in turn, each job script may kick off more worker scripts in /workers folder again in child processes.

as scripts in may reference scripts in /libs folder, i'm trying avoid relative path reference

var libscript = require('../../libs/libscript');  

i have viewed few solution proposed online such

these articles fantastic considering problem within same process. have faced similar situation mine , have possible solutions?

the issue here how find parent's working directory child process or grand-child process.

i'm running in windows.

thanks.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -