You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,12 @@ A helper function is also provided:
26
26
27
27
This works by passing the current module's `require` method (each module has its *own*`require` method) to the `app-root-path` module, which then returns a wrapper for that method that prepends the application's root path to whatever path is passed to it.
28
28
29
+
Finally, you can also just resolve a module path:
30
+
31
+
```js
32
+
var myModulePath =require('app-root-path').resolve('/lib/my-module.js');
33
+
```
34
+
29
35
## How It Works
30
36
31
37
This module works on the assumption that your application's root path is the parent of the `node_modules` directory. Here's almost all the module's logic:
0 commit comments