v5.24.0
Minor Changes
- Allow the
contextpath andrequestarguments ofresolve(andresolveSync/resolvePromise) to acceptfile:URLinstances, converting them to filesystem paths. Plain strings stay literal paths, matching Node'sfs. (by @alexander-akait in #607)
Patch Changes
-
Make the resolver runtime-agnostic so it works in browsers, Deno and Bun as well as Node. File contents are decoded without assuming a Node
Buffer, and browser shims are provided for thepath,urlandgraceful-fsbuiltins (Node, Deno and Bun keep using the native ones) so the package bundles for the browser — supply your ownfileSystemthere. (by @alexander-akait in #606) -
Rename the positional
resolve/resolveSync/resolvePromiseparameters toparent/specifier(frompath/request) for ESM-aligned naming and document them in the README. Purely cosmetic — arguments are positional, so there is no behavior or API change. (by @alexander-akait in #611)