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

@serve-tools/ponyfill-resource-management

v0.1.4

Published

Implements Explicit Resource Management without global mutation

Readme

@serve-tools/ponyfill-resource-management

The @serve-tools/ponyfill-resource-management package implements ECMAScript Explicit Resource Management, which reached TC39 Stage 4 in May 2026, without modifying the global environment.

import { DisposableStack } from "@serve-tools/ponyfill-resource-management";

const stack = new DisposableStack();

stack.defer(() => console.log("disposed"));
stack.dispose();

Install

npm install @serve-tools/ponyfill-resource-management

Usage

Dispose a resource stack

import {
	DisposableStack,
	dispose,
} from "@serve-tools/ponyfill-resource-management";

const stack = new DisposableStack();

stack.use({
	[dispose]() {
		console.log("disposed");
	},
});

stack.dispose();

Adopt values that do not implement the disposal protocol by supplying a cleanup callback:

const stack = new DisposableStack();
const controller = stack.adopt(new AbortController(), (value) => value.abort());

// Use controller...
stack.dispose();

AsyncDisposableStack accepts resources keyed by asyncDispose and falls back to dispose for synchronous resources. Both stack classes dispose resources in reverse registration order and combine multiple failures with SuppressedError.

These synchronous and asynchronous stack patterns are covered by the package's TypeScript fixtures and runtime tests.

Public API

  • dispose and asyncDispose: stable symbols scoped to this module.
  • Disposable and AsyncDisposable: TypeScript resource interfaces.
  • DisposableStack and AsyncDisposableStack: resource stack implementations.
  • SuppressedError: an error that preserves multiple disposal failures.

The root entrypoint exports the complete API. Individual public declarations can also be imported from their named ./lib/* subpaths, such as @serve-tools/ponyfill-resource-management/lib/DisposableStack.

Ponyfill boundary

The exported symbols are intentionally created with Symbol() and are not stored in the global symbol registry. They are distinct from native Symbol.dispose and Symbol.asyncDispose, so resources used with this package must use the exported symbols.

The package does not install globals or transform using and await using syntax. Use native Explicit Resource Management when native symbol identity or syntax integration is required.

Compatibility

The package is an ES module for JavaScript runtimes with Symbol and promises, including browsers, workers, and Node.js. It does not depend on native explicit resource management, but its module-scoped symbols intentionally do not interoperate with native using declarations or objects keyed by native disposal symbols.

Agent Skill

This package includes skills/serve-tools-ponyfill-resource-management/SKILL.md with version-aligned usage guidance for compatible coding agents. Activation is explicit; installing the package does not automatically trust or enable it.

Development

npm run typecheck --workspace @serve-tools/ponyfill-resource-management
npm test --workspace @serve-tools/ponyfill-resource-management
npm run build --workspace @serve-tools/ponyfill-resource-management

License

MIT-0