Skip to content
Newer
Older
100644 24 lines (17 sloc) 741 Bytes
7885443 @substack readme before any code
authored Jun 18, 2011
1 resolve
2 =======
3
4 Implements the [node `require.resolve()`
5 algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)
6 except you can pass in the file to compute paths relatively to along with your
7 own `require.paths` without updating the global copy (which doesn't even work in
8 node `>=0.5`).
9
10 methods
11 =======
12
5218f01 @substack implementation seems to work but no tests yet
authored Jun 18, 2011
13 var resolve = require('resolve');
14
78010b1 @substack opts.path => opts.basedir, more descriptive I think
authored Jun 18, 2011
15 resolve.sync(pkg, opts={paths:[],basedir:__dirname})
16 ----------------------------------------------------
7885443 @substack readme before any code
authored Jun 18, 2011
17
5218f01 @substack implementation seems to work but no tests yet
authored Jun 18, 2011
18 Synchronously search for the package/filename string `pkg`
7885443 @substack readme before any code
authored Jun 18, 2011
19 according to the [`require.resolve()`
20 algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)
78010b1 @substack opts.path => opts.basedir, more descriptive I think
authored Jun 18, 2011
21 for `X=pkg` and `Y=opts.basedir`.
7885443 @substack readme before any code
authored Jun 18, 2011
22
78010b1 @substack opts.path => opts.basedir, more descriptive I think
authored Jun 18, 2011
23 If nothing is found, all of the directories in `opts.paths` are searched.
Something went wrong with that request. Please try again.