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

@emulates/eventbridge

v1.0.0

Published

Seeded AWS EventBridge rule and ECS target discovery with pagination.

Readme

@emulates/eventbridge

Part of Emulates: high-fidelity, in-process emulators for APIs and databases.

WIP AWS EventBridge control-plane discovery. Seeded rule and target reads use AWS JSON 1.1; no containers or infrastructure are executed. Follows the official ListRules, ListTargetsByRule and common errors.

Install

bun add @emulates/eventbridge

Usage

import { createServer } from "@emulates/eventbridge/server"
const server = await createServer({
  rules: [{ rule: { Name: "nightly", Arn: "arn:aws:events:us-east-1:000000000000:rule/nightly" }, targets: [] }],
})
// boto3.client("events", endpoint_url=server.url, region_name="us-east-1",
//              aws_access_key_id="fixture", aws_secret_access_key="fixture")
await server.close()

CLI: emulates-eventbridge serve --port 12128. Set your client factory's endpoint_url or AWS_ENDPOINT_URL_EVENTBRIDGE to that URL. The default instance has no rules. POST / dispatches X-Amz-Target AWSEvents.ListRules and AWSEvents.ListTargetsByRule. NamePrefix filters names; Limit (1–100) and NextToken paginate rules and targets. The terminal page omits NextToken. Missing buses/rules return ResourceNotFoundException (400).

Controls and state

Seed through options.rules ({rule, targets}) or POST /__admin/state/rules with {id: "default:nightly", value: {rule: {Name, Arn}, targets: [{Id, Arn, EcsParameters}]}}. Custom buses must also be seeded in options.buses or /__admin/state/buses ({name}). The default bus always exists. Rule.EventBusName defaults to default. Target objects, including TaskDefinitionArn and awsvpcConfiguration, round-trip without execution. State collections: rules, buses, cursors and initialization marker. Shared /__admin provides health, state, reset, Timeline checkpoints, clock, journal, metrics and UI. Namespaces work via x-emulates-namespace, /__admin/ns/name and SigV4 access-key mappings set with PUT /__admin/credentials. No cryptographic signature or IAM evaluation is performed. The journal records metadata, not request bodies or credentials.

Presets: access_denied (403), throttled (AWS 400), rate_limited (explicit HTTP 429 fault), internal_error (500), connection_drop. Standard faults support deterministic latency. No outbound webhooks are emitted.

Verification

Run bun test here for acceptance, JS SDK, self-parity and deliberate divergence tests. Run bun scripts/sdk.ts with uv installed for the separate pinned boto3 1.43.56 drop-in/paginator/error proof (uv obtains that exact package; no AWS credentials are needed). Live safe empty-prefix discovery: bun run parity with EVENTBRIDGE_ACCESS_KEY_ID, EVENTBRIDGE_SECRET_ACCESS_KEY, optional EVENTBRIDGE_REGION. Missing credentials exit 2. The SDK tests prove client compatibility, not live AWS equivalence.

Deliberately not modelled

Rule/target mutation, event delivery, schedules, IAM policy evaluation, cryptographic SigV4 validation, real execution, provisioning and deployment. Seeded resources are fixtures, not AWS accounts. Cursor strings and their one-hour emulator-clock lifetime are deterministic local stand-ins; AWS does not document a fixed lifetime or wire token format. Pagination binds arguments but does not freeze a snapshot of concurrent fixture edits. Result order is fixture insertion order, not a guarantee about AWS ordering. HTTP 429 is a test fault, not the normal EventBridge throttling status.

API

  • EventbridgeAPI, createAwsRuntime, and createAwsServer (server entry): separate extended AWS operations runtime.

Main exports: EventBridgeAPI, EVENTBRIDGE_NAMESPACE, createRuntime, EVENTBRIDGE_PRESETS, document, operationIds, supportedOperationIds. Types: Rule, Target, SeedRule, EventBridgeAPIOptions, EventBridgeRuntimeOptions, EventBridgeRuntime. Server entry: createServer, DEFAULT_PORT, serveTarget; type EventBridgeServerOptions. CLI entry runs the serve command and exports no runtime values.

Extended AWS operations runtime

createAwsRuntime (and createAwsServer from the server entry) exposes the additional LocalStack-oriented event bus, rule, target, event ingestion and tagging operations. It has separate state and does not claim the seeded discovery runtime's pagination behavior. The default createRuntime retains the documented discovery contract and fixtures. Both modes remain WIP. Run bun run parity:localstack for the extended runtime.