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
+16-16
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,14 @@
2
2
3
3
Require from a directory relative to node_modules, flattening your require paths. Using requireFrom you won't have to manage complex relative paths between each component of your node app.
4
4
5
+
Alternatively check out [wavy](https://www.npmjs.com/package/wavy) or [link-local](https://www.npmjs.com/package/linklocal) if symlinks might be a better solution for your project.
6
+
5
7
## Code Example
6
8
7
9
Simple usage anywhere in your node app:
8
10
````js
9
-
var lib =require('requirefrom')('lib');
10
-
var myModule =lib('myModule');
11
+
let lib =require('requirefrom')('lib');
12
+
let myModule =lib('myModule');
11
13
````
12
14
13
15
For more complex usage, let's assume this example directory structure:
@@ -29,29 +31,27 @@ For more complex usage, let's assume this example directory structure:
29
31
30
32
Any file in this project could then include these files with the following code:
0 commit comments