Skip to content

Commit 1a2d4df

Browse files
marionebldefunctzombie
authored andcommitted
Add references to node-resolve for options documentation (#82)
* Adds `basedir` to documented options * Sorts options section alphabetically * Add references to node-resolve options
1 parent 0955baf commit 1a2d4df

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ Resolve a module path and call `cb(err, path [, pkg])`
1010

1111
Options:
1212

13+
* `basedir` - directory to begin resolving from
14+
* `browser` - the 'browser' property to use from package.json (defaults to 'browser')
1315
* `filename` - the calling filename where the `require()` call originated (in the source)
14-
* `paths` - `require.paths` array to use if nothing is found on the normal `node_modules` recursive walk
15-
* `packageFilter` - transform the parsed `package.json` contents before looking at the `main` field
1616
* `modules` - object with module id/name -> path mappings to consult before doing manual resolution (use to provide core modules)
17-
* `browser` - the 'browser' property to use from package.json (defaults to 'browser')
17+
* `packageFilter` - transform the parsed `package.json` contents before looking at the `main` field
18+
* `paths` - `require.paths` array to use if nothing is found on the normal `node_modules` recursive walk
19+
20+
Options supported by [node-resolve](https://github.com/substack/node-resolve#resolveid-opts-cb) can be used.
1821

1922
### resolve.sync(id, opts={})
2023

2124
Same as the async resolve, just uses sync methods.
2225

26+
Options supported by [node-resolve](https://github.com/substack/node-resolve#resolvesyncid-opts) `sync` can be used.
27+
2328
## basic usage
2429

2530
you can resolve files like `require.resolve()`:

0 commit comments

Comments
 (0)