Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

resultar

Latest version: v5.0.0-beta.2

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: inaiat
5 Stars
0 Forks
15 Versions
2.9K Downloads
TypeScript Repo language

Scan summary

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.

  • Releases: 15 versions; the latest 3 were published within 2 days (22 and 23 Nov 2026).
  • Findings: No rules fired in version 5.0.0-beta.2.
  • Downloads: 2,870 downloads.

Versions

15 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 5.0.0-beta.2

Findings

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.

README

The publisher’s own README, as collected from the registry.

Resultar

Typed, composable error handling and resilient workflows for TypeScript — from a single Result<T, E> to lazy, dependency-injected ResultTask<T, E, R>.

Node.js 24+ ESM Only TypeScript 7 Native Checks License: MIT

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.


Why Resultar in 30 Seconds

Before: Hidden failures

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;
};
After: Explicit, typed contracts

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 });
};
End-to-End: Compose linearly, handle exhaustively

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 } }),
});

Highlights & Positioning

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
Where Resultar Sits Between neverthrow and Effect

Resultar 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

Install

pnpm add resultar
# or
npm install resultar
  • Runtime: Node.js 24+, ESM-only (import { ok, Result } from 'resultar')
  • JSR: Also available as @inaiat/resultar
  • Diagnostics (optional): pnpm add -D resultar-check (requires TypeScript 7+)

What's New in v4

  • 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()).
  • Unified execution boundary (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.).
  • Plain-return generators (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.
  • Canonical error boundaries & sound tagged recovery: 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.
  • Context-aware pattern matching & framework scopes: 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.
  • Gradual migration & eager 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, and PromiseLike boundary notes.


Adopt Gradually: Three Primitives, One Mental Model

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&lt;T, E&gt;</b><br/>Synchronous value (Ok / Err)<br/>Zero async overhead"]
  RT["<b>2. ResultTask&lt;T, E, R&gt;</b><br/>Default for new async workflows<br/>Lazy, repeatable, explicit runners"]
  RA["<b>ResultAsync&lt;T, E&gt;</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
Sync-First, Pay-As-You-Go Execution Engine

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:

  • *Explicit `yieldinterop**: CoreResult.gen/Result.fnsupport sync and eager async generators.ResultTask.gencomposes Results, Tasks and service tags; adapt Async withfromResultAsync. SatisfyingR` keeps the Task contract.
  • Zero-microtask synchronous fast path: 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.
  • Pay only for the stage you use: Service maps, LIFO finalizer stacks, and fiber schedulers are allocated lazily only when a workflow invokes service(), acquireRelease(), or forkChild().

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm resultar

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229