Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@loaderkit/resolve

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaderkit/resolve

[![npm version](https://badgen.now.sh/npm/v/@loaderkit/resolve)](https://www.npmjs.com/package/@loaderkit/resolve) [![isc license](https://badgen.now.sh/npm/license/@loaderkit/resolve)](https://github.com/braidnetworks/loaderkit/blob/main/LICENSE) [![gith

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

npm version isc license github action npm downloads

🔎 @loaderkit/resolve - General purpose nodejs module resolver

An accurate & abstract implementation of the nodejs module resolution algorithms. It implements both the CommonJS and modules algorithms. Originally authored for arethetypeswrong.

See also: resolve, enhanced-resolve, and esm-resolve. The main point of this package is accuracy with the default nodejs resolution algorithms.

  • Does nothing that the nodejs default resolver doesn't do
  • Runs in a web browser w/ abstract filesystems
  • Sensible TypeScript-first types
  • Shakeable ESM exports
  • Promise & synchronous implementations

Usage

import { resolve, resolveSync } from '@loaderkit/resolve/esm';
import { resolve as resolveRequire, resolveSync as resolveRequireSync } from '@loaderkit/resolve/cjs';
import { defaultAsyncFileSystem, defaultSyncFileSystem } from '@loaderkit/resolve/fs';

// Async module resolution
const resolution = await resolve(defaultAsyncFileSystem, 'react', new URL(import.meta.url));
console.log(resolution.format, resolution.url);
// format: "addon" | "builtin" | "commonjs" | "json" | "module" | "wasm"
// url: typeof URL

// Synchronous module resolution
resolveSync(defaultSyncFileSystem, 'react', new URL(import.meta.url));

// CommonJS module resolution
await resolveRequire(defaultAsyncFileSystem, 'lodash', new URL(import.meta.url));
resolveRequireSync(defaultSyncFileSystem, 'lodash', new URL(import.meta.url));

The FileSystemAsync and FileSystemSync interfaces can be implemented by client code as necessary. For example, you could write a delegate to load the module source files from a zip file, from the internet, or whatever you want.

FAQs

Package last updated on 18 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts