node.js - Path of the requiring script inside the required script -


i have 2 scripts: first requiring second.

1st script main.js:

... var = require(second); ... 

2d. script second.js

path = path/of/the/main/script 

i want access path of first script within second script without passing argument. way achieve it?

module.parent.filename holds file name of calling script. see here more information.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -