Scan your whole stack
Are you using resultar?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v5.0.0-beta.2
resultar was last scanned on 23 Nov 2026 at version 5.0.0-beta.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 5.0.0-beta.2 LATEST | 23 Nov 2026 | No rules fired |
| 5.0.0-beta.1 | 23 Nov 2026 | No rules fired |
| 5.0.0-beta.0 | 22 Nov 2026 | No rules fired |
| 4.1.1 | 16 Nov 2026 | Not shown |
| 4.1.0 | 16 Nov 2026 | Not shown |
Findings for v5.0.0-beta.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 5.0.0-beta.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Typed, composable error handling and resilient workflows for TypeScript — from a single Result<T, E> to lazy, dependency-injected ResultTask<T, E, R>.
What's New in v4 · v4 Migration · Gradual Adoption · Full Reference (DOCUMENTATION.md) · resultar-check Compiler CLI/LSP · Benchmarks · API Decision Guide
In standard TypeScript, throw and rejected promises are invisible in function signatures. Callers have no way of knowing what can fail—or whether they handled every failure case—without reading the implementation.
Resultar moves expected failures into the type system and gives you a complete toolkit to compose, recover, retry, time out, and exhaustively match them from synchronous domain logic to production async workflows.
This signature promises a number, but silently throws at runtime:
const parsePort = (input: string): number => {
const port = Number(input);
if (!Number.isInteger(port) || port <= 0) {
throw new Error(`Invalid port ${input}`); // invisible to TypeScript!
}
return port;
};
With Resultar, expected failures are first-class values in the return type:
import { createTaggedError, ok, type Result } from "resultar";
class InvalidPortError extends createTaggedError({
name: "InvalidPortError",
message: "Invalid port $input",
}) {}
const parsePort = (input: string): Result<number, InvalidPortError> => {
const port = Number(input);
return Number.isInteger(port) && port > 0 ? ok(port) : InvalidPortError.err({ input });
};
Write linear workflows without nested try/catch blocks. TypeScript automatically infers the combined error union across every yield* step and enforces exhaustive handling at your application boundary:
import { createTaggedError, ok, ResultTask, type Result } from "resultar";
// 1. Define real Error subclasses with typed template props ($email, $operation)
class InvalidEmailError extends createTaggedError({
name: "InvalidEmailError",
message: "Invalid email $email",
}) {}
class AccountExistsError extends createTaggedError({
name: "AccountExistsError",
message: "Account $email already exists",
}) {}
class DatabaseError extends createTaggedError({
name: "DatabaseError",
message: "Database $operation failed",
}) {}
// 2. Write domain & infrastructure steps with explicit error channels
const normalizeEmail = (raw: string): Result<string, InvalidEmailError> => {
const email = raw.trim().toLowerCase();
return email.includes("@") ? ok(email) : InvalidEmailError.err({ email });
};
const registerAccount = (input: string) =>
ResultTask.gen(function* () {
const email = yield* normalizeEmail(input);
if (email === "taken@example.com") {
return yield* AccountExistsError.err({ email });
}
return yield* ResultTask.tryPromise({
try: () => db.accounts.insert({ email }),
catch: (cause) => new DatabaseError({ cause, operation: "insert-account" }),
});
});
// Inferred return type:
// ResultTask<Account, InvalidEmailError | AccountExistsError | DatabaseError>
// 3. Handle every possible error at the HTTP boundary (compile error if a tag is missed!)
const result = await registerAccount(req.body.email).runResult();
const response = result.matchTags((account) => ({ status: 201, body: account }), {
InvalidEmailError: (err) => ({ status: 400, body: { code: err._tag, message: err.message } }),
AccountExistsError: (err) => ({ status: 409, body: { code: err._tag, message: err.message } }),
DatabaseError: (err) => ({ status: 503, body: { code: err._tag, message: err.message } }),
});
| What you need | What Resultar provides |
|---|---|
| Expected failures in the type system | Result<T, E> for sync values, ResultTask<T, E, R> for lazy async workflows, and ResultAsync<T, E> as the in-flight Result returned by task.runResult() |
| Structured production errors | Real Error subclasses via createTaggedError with $prop interpolation, cause, fingerprints, and secret redaction |
Linear code without try/catch |
Result.gen / Result.fn and ResultTask.gen / ResultTask.fn using yield* short-circuiting |
| Exhaustive boundary handling | matchTags, catchTag, catchTags, and general-purpose Match pattern matching |
| Production async resilience | Built-in timeout, retry (with portable Retry.policy), race, bounded forEach, and resource cleanup |
| Lazy tasks & typed dependencies | ResultTask<T, E, R> with typed service requirements (R), AbortSignal cancellation, and LIFO resource scopes |
| Compiler guardrails | Optional native resultar-check CLI & LSP to forbid ignored results (noDiscard) and raw throw |
neverthrow and EffectResultar began as a fork of neverthrow. It keeps the approachable Ok / Err mental model while adding structured concurrency, scoped resources, typed DI, and native compiler diagnostics—without forcing a global runtime on your codebase:
| Capability | neverthrow |
Resultar |
Effect |
|---|---|---|---|
| Adoption unit | 1 function (Result<T, E>) |
1 function (Result<T, E>) |
Full Effect<A, E, R> ecosystem |
Direct await on async results |
Yes (ResultAsync<T, E>) |
Task uses explicit task.runResult(), returning awaitable ResultAsync |
No (requires Effect.runPromise / runtime) |
Tagged Error classes & secret redaction |
Manual | Built-in (createTaggedError, redact) |
Built-in (Data.TaggedError, Redacted) |
| Retries, timeouts, races & virtual clock | Manual | Built-in (Retry.policy, timeout, Clock.virtual) |
Built-in (Schedule, TestClock) |
Typed DI (R), LIFO resource scopes & fibers |
No | Opt-in via ResultTask<T, E, R> & resultar-di |
Always present (Effect<A, E, R>, Layer, Scope) |
Compiler enforcement (noDiscard) |
ESLint plugin | Native TypeScript-Go CLI & LSP (resultar-check) |
Language service plugin |
pnpm add resultar
# or
npm install resultar
import { ok, Result } from 'resultar')@inaiat/resultarpnpm add -D resultar-check (requires TypeScript 7+)ResultTask<T, E, R> is the default for new async workflows: Lazy, repeatable execution blueprints with typed service requirements (R), LIFO resource cleanup (acquireRelease, acquireDisposable, scoped), structured child fibers (forkChild, Fiber), bounded collection concurrency (all, forEach, validateAll, makeSemaphore), portable retry policies (Retry.policy), and deterministic virtual time (Clock.virtual()).task.runResult() returns ResultAsync<T, E>): Execute tasks explicitly via instance or static runners (runResult, runPromise, runExit, runFork). task.runResult() starts the task and returns an in-flight ResultAsync<T, E> (PromiseLike<Result<T, E>>) that can be awaited directly or transformed and folded with Result methods (map, andThen, catchTag, matchTags, unwrapOr, etc.).Result.gen / Result.fn & ResultTask.gen / ResultTask.fn): Generator workflows unwrap steps with yield* and return plain success values (return value), while legacy safeTry remains supported for final-Result generator bodies.Result.try, ResultAsync.try, ResultTask.try, and ResultTask.tryPromise accept both (fn, catchFn) and { try, catch }. Tagged recovery (catchTag, catchTags, matchTagsPartial) removes an error from E only when its handler is required and defined across all table variants.Match.context<Input, [ctx]>() builds reusable route/event matchers without repeating the matched input, and resultar-di, resultar-hono, and resultar-fastify wire application and request scopes automatically.ResultAsync compatibility: In-flight constructors (okAsync, errAsync, unitAsync, fromPromise, fromSafePromise, tryResultAsync) remain active in resultar, while legacy eager ResultAsync orchestration helpers remain supported as @deprecated compatibility APIs.Upgrading from v3? Read the full v4 Migration & Compatibility Guide (
docs/migrations/v4.md) for the complete before/after API table, retained aliases, andPromiseLikeboundary notes.
You do not need to rewrite your application to use Resultar. Start with a single function returning Result<T, E> and scale up only when a workflow needs async I/O or typed dependencies:
flowchart LR
R["<b>1. Result<T, E></b><br/>Synchronous value (Ok / Err)<br/>Zero async overhead"]
RT["<b>2. ResultTask<T, E, R></b><br/>Default for new async workflows<br/>Lazy, repeatable, explicit runners"]
RA["<b>ResultAsync<T, E></b><br/>In-flight Result (PromiseLike)<br/>Await or chain like Result"]
R -->|"async I/O, retry, timeout"| RT
RT -->|"task.runResult()"| RA
RA -->|"fromResultAsync(existing or factory)"| RT
T is the success value.E is the expected failure type.R is the typed service environment or resource scope required before a ResultTask can run (never when no external requirements remain).Prefer ResultTask for new asynchronous workflows and run it explicitly, including when
R = never. Providing services or closing a scope leaves a Task. Calling task.runResult()
(or ResultTask.runResult(task)) starts the task and returns ResultAsync<T, E> — an in-flight
Result (PromiseLike<Result<T, E>>) that can be awaited directly or transformed and folded
with the same methods as Result. In-flight constructors (okAsync, errAsync, unitAsync, fromPromise, fromSafePromise, tryResultAsync) are active in resultar, while static orchestration methods on
ResultAsync remain deprecated in resultar for existing eager contracts.
Its inbound fromResultAsync bridge accepts structural PromiseLike<Result<T, E>> values.
Use ResultTask.tryPromise({ try, catch }) directly for raw Promise-returning drivers.
New async repositories and use cases return Tasks without an async modifier;
native Promise returns belong to explicit runners or framework/SDK boundaries.
See the boundary decision table.
| Stage | When to use it | Key APIs |
|---|---|---|
1. Result<T, E> |
Synchronous validation, parsing, and domain rules | ok, err, map, andThen, Result.gen, match |
2. ResultTask<T, E, R> |
New asynchronous workflows; add typed services, cooperative cancellation, and scopes as needed | ResultTask.gen, ResultTask.fn, tryPromise, service, acquireRelease, runResult |
ResultAsync<T, E> |
In-flight Result returned by task.runResult() (and existing eager async contracts) |
await, map, andThen, catchTag, match, matchTags, unwrapOr, unwrapOrThrow |
Result values remain synchronous, and the Task runtime uses synchronous fast paths until an asynchronous step is needed. The separate Async facade retains its memoized Promise contract:
interop**: CoreResult.gen/Result.fnsupport sync and eager async generators.ResultTask.gencomposes Results, Tasks and service tags; adapt Async withfromResultAsync. SatisfyingR` keeps the Task contract.Result.gen, synchronous ResultTask pipelines, and ResultTask.scoped workflows without async steps execute inside a tight synchronous while loop (runTaskLoop / #runGen) without scheduling microtasks—reusing static singletons (sharedSuccessExit, idleTaskIterator, idleRunContext) on the happy path until a real Promise or cooperative yieldEvery checkpoint is encountered.service(), acquireRelease(), or forkChild().Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.