Unofficial Node-compatible module resolution layers.
Not affiliated with the projects these packages wrap; oxc-resolver is developed
by oxc-project.
A thin compatibility layer over oxc-resolver
that keeps its API and fixes up two Node.js / CommonJS resolution details
upstream trades for speed:
LOAD_AS_FILE(DIR/X)is tried beforeLOAD_AS_DIRECTORY(DIR/X)for a bare package name, so a siblingnode_modules/X.jswins overnode_modules/X/(unless the package declaresexports, which takes precedence over both).- the entry directory is canonicalized before resolution, like Node does when symlinks are enabled.
Everything else, including bug fixes, comes from oxc-resolver.
import { ResolverFactory } from '@uncompat/oxc-resolver';
const resolver = new ResolverFactory({ extensions: ['.js', '.ts'] });
resolver.sync(process.cwd(), 'some-package');Experimental. The shims are intentionally small; upstream fixes should be preferred and the corresponding shim removed once released.