Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created December 11, 2012 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/4259909 to your computer and use it in GitHub Desktop.
Save isaacs/4259909 to your computer and use it in GitHub Desktop.
$ tree
.
├── a/
│   ├── node_modules/
│   │   └── b -> ../../b/
│   └── index.js
├── b/
│   ├── node_modules/
│   │   └── c -> ../../c/
│   └── index.js
└── c/
└── index.js
7 directories, 3 files
$ cat a/index.js
console.log('loaded a');
require('b');
$ cat b/index.js
console.log('loaded b');
require('c');
$ cat c/index.js
console.log('loaded c');
$ node a/index.js
loaded a
loaded b
loaded c
# Also works if you link to the actual files
$ tree
.
├── a/
│   ├── node_modules/
│   │   └── b/
│   │   └── index.js -> ../../../b/index.js
│   └── index.js
├── b/
│   ├── node_modules/
│   │   └── c/
│   │   └── index.js -> ../../../c/index.js
│   └── index.js
└── c/
└── index.js
7 directories, 5 files
$ node a
loaded a
loaded b
loaded c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment