Skip to content

Commit 02a5efe

Browse files
committed
docs: mention resolveSync and resolvePathSync utils
1 parent 5223f5a commit 02a5efe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ Several utilities to make ESM resolution easier:
4040
- Supporting custom `conditions`
4141
- Support resolving from multiple paths or urls
4242

43-
### `resolve`
43+
### `resolve` / `resolveSync`
4444

4545
Resolve a module by respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
4646
(using [wooorm/import-meta-resolve](https://github.com/wooorm/import-meta-resolve)).
4747

4848
Additionally supports resolving without extension and `/index` similar to CommonJS.
4949

5050
```js
51-
import { resolve } from "mlly";
51+
import { resolve, resolveSync } from "mlly";
5252

5353
// file:///home/user/project/module.mjs
5454
console.log(await resolve("./module.mjs", { url: import.meta.url }));
@@ -60,12 +60,12 @@ console.log(await resolve("./module.mjs", { url: import.meta.url }));
6060
- `conditions`: Array of conditions used for resolution algorithm (default is `['node', 'import']`)
6161
- `extensions`: Array of additional extensions to check if import failed (default is `['.mjs', '.cjs', '.js', '.json']`)
6262
63-
### `resolvePath`
63+
### `resolvePath` / `resolvePathSync`
6464
6565
Similar to `resolve` but returns a path instead of URL using `fileURLToPath`.
6666
6767
```js
68-
import { resolvePath } from "mlly";
68+
import { resolvePath, resolveSync } from "mlly";
6969

7070
// /home/user/project/module.mjs
7171
console.log(await resolvePath("./module.mjs", { url: import.meta.url }));

0 commit comments

Comments
 (0)