diff --git a/README.md b/README.md index 8be7376..063b3b7 100644 --- a/README.md +++ b/README.md @@ -131,15 +131,15 @@ const { someFunction } = importSync(
-### 2.1. relativePath +### 2.1. id -Path to the module relative to the current file, similar to CommonJS [require](https://nodejs.org/api/modules.html#requireid). For example, +Module name or relative path similar to CommonJS [require](https://nodejs.org/api/modules.html#requireid). For example, - `'../animals/cats.js'` - `'./dogs.mjs'` -- `'minimal'` +- `'./minimal'` - `importSync` will look for `'./minimal.js'` before `'./minimal.mjs'` - -Note that `option.basePath` can be provided to alter this behaviour. +- `'node-fetch'` + - `importSync` can import pure-esm [node-fetch](https://github.com/node-fetch/node-fetch) (v3) in your cjs project ### 2.2. options @@ -153,7 +153,19 @@ Note that `option.basePath` can be provided to alter this behaviour. basePath - Absolute path to the module's directory + + Absolute path to the module's directory. The basePath option will only take effect if the given id starts with ./ or ../. For example, + + and not + +
 process.cwd()