Skip to content

Commit

Permalink
fixup!: document when pjson is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Oct 17, 2024
1 parent 3171d6d commit debf4c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ added: REPLACEME
* `startLocation` {string|URL} Where to look (relative to `parentLocation`). This can be a
relative/unresolved specifier (ex `'..'`) or a package name.
* `parentLocation` {string|URL} The absolute location (`file:` URL string or FS path) of the containing
module. For CJS, use `__filename` (not `__dirname`!); for ESM, use `import.meta.url`.
* Returns: {string} A file URL string. When `startLocation` is a package, the package's root
`package.json`; when a relative or unresolved, the closest `package.json` to the `startLocation`.
* `parentLocation` {string|URL} The absolute location (`file:` URL string or FS path) of the
containing module. For CJS, use `__filename` (not `__dirname`!); for ESM, use `import.meta.url`.
* Returns: {string|undefined} A file URL string if the `package.json` is found. When `startLocation`
is a package, the package's root `package.json`; when a relative or unresolved, the closest
`package.json` to the `startLocation`.
> **Caveat**: Do not use this to try to determine module format. There are many things effecting
> that determination; the `type` field of package.json is the _least_ definitive (ex file extension
Expand Down

0 comments on commit debf4c6

Please sign in to comment.