npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yieldless

v0.1.0

Published

Zero-runtime-bloat functional primitives for async TypeScript.

Downloads

107

Readme

Yieldless

Yieldless is a small TypeScript library for people who like the ergonomics of Effect-style code but do not want a custom runtime in the middle of everything.

The library is built around four ideas:

  • error handling as simple tuples
  • structured concurrency through AbortController
  • resource cleanup through native await using
  • dependency injection through plain functions

There are no runtime dependencies, and the package is split into subpath exports so callers can pull in only the piece they want.

Status

This repo is intentionally small. The goal is to keep the surface area obvious and let the platform do as much of the work as possible.

Installation

pnpm add yieldless

TypeScript 5.5+ is the target baseline. The package is compiled with isolatedDeclarations enabled.

Modules

yieldless/error

safeTry and safeTrySync turn thrown values into [error, value] tuples.

import { safeTry, safeTrySync, unwrap } from "yieldless/error";

const [readError, body] = await safeTry(fetch("https://example.com"));

if (readError) {
  console.error(readError);
}

const parsed = safeTrySync(() => JSON.parse("{\"ok\":true}"));
const value = unwrap(parsed);

yieldless/task

runTaskGroup gives you shared cancellation without a separate scheduler or fiber runtime.

import { runTaskGroup } from "yieldless/task";

const result = await runTaskGroup(async (group) => {
  const userTask = group.spawn(async (signal) => loadUser(signal));
  const auditTask = group.spawn(async (signal) => writeAuditLog(signal));

  const user = await userTask;
  await auditTask;

  return user;
});

If one spawned task fails, the group aborts the shared signal, waits for the remaining children to settle, and then rethrows the original failure.

yieldless/resource

acquireResource wraps a value with native async disposal.

import { acquireResource } from "yieldless/resource";

{
  await using db = await acquireResource(connect, disconnect);
  await db.value.query("select 1");
}

The release function runs once when the scope exits.

yieldless/di

inject is just dependency binding for plain functions.

import { inject } from "yieldless/di";

const handler = (
  deps: { logger: { info(message: string): void } },
  name: string,
) => {
  deps.logger.info(`hello ${name}`);
};

const run = inject(handler, {
  logger: console,
});

run("world");

Design Notes

The package leans on current platform features rather than inventing replacements for them:

  • Promise and async/await for sequencing
  • AbortController and AbortSignal for cancellation
  • AsyncDisposable and Symbol.asyncDispose for cleanup
  • ordinary higher-order functions for dependency injection

That keeps the implementation small and makes the failure modes easier to reason about when something goes wrong.

Caveats

  • SafeResult uses null as the sentinel value in each tuple slot. If your success value is literally null, the type system cannot fully discriminate that case.
  • runTaskGroup can only cancel work that actually respects the passed AbortSignal.
  • await using requires runtime support for explicit resource management.

Development

pnpm install
pnpm build
pnpm check