# @rspack/resolver

> Rspack Resolver Node API

Latest version **0.6.0** (published 2026-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rspack/resolver
pnpm add @rspack/resolver
yarn add @rspack/resolver
bun add @rspack/resolver
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2026-08-11 |
| First published | 2025-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 38.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 42 |
| Maintainers | hardfist3, chenjiahan, stormslowly |

## Links

- npm: https://www.npmjs.com/package/@rspack/resolver
- Repository: https://github.com/rstackjs/rspack-resolver
- npm.io page: https://npm.io/package/@rspack/resolver

## Recent versions

- 0.6.0 (latest) — 2026-08-11
- 0.2.8-alpha.0 (alpha) — 2026-03-09
- 0.5.4 — 2026-07-07
- 0.5.3 — 2026-06-22
- 0.5.2 — 2026-05-29
- 0.5.1 — 2026-05-25
- 0.5.0 — 2026-05-22
- 0.4.0 — 2026-04-07
- 0.3.0 — 2026-03-17
- 0.2.8 — 2026-03-09
- 0.2.7 — 2026-03-02
- 0.2.6 — 2026-01-04
- 0.2.5 — 2025-11-19
- 0.2.4 — 2025-11-11
- 0.2.3 — 2025-10-27
- … 8 more at https://npm.io/package/@rspack/resolver/versions

## README

# Rspack Resolver Napi Binding

See

- `index.d.ts` for `resolveSync` and `ResolverFactory` API.
- [README.md](https://github.com/rstackjs/rspack-resolver?tab=readme-ov-file#rspack-resolver) for options.

## API

`resolve(directory, specifier)` - resolve `specifier` at an absolute path to a `directory`.

### `directory`

An **absolute** path to a directory where the specifier is resolved against.

For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module.

For ECMAScript modules, it is the value of `import.meta.url`.

Behavior is undefined when given a path to a file.

### `specifier`

The string passed to `require` or `import`, i.e. `require("specifier")` or `import "specifier"`

## ESM Example

```javascript
import path from "path";
import resolve, { ResolverFactory } from "./index.js";
import assert from "assert";

// `resolve`
assert(
  resolve.sync(process.cwd(), "./index.js").path,
  path.join(cwd, "index.js")
);

// `ResolverFactory`
const resolver = new ResolverFactory();
assert(
  resolver.sync(process.cwd(), "./index.js").path,
  path.join(cwd, "index.js")
);
```

---
_Source: https://npm.io/package/@rspack/resolver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
