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

@semilayer/bridge-resolver

v1.6.0

Published

SemiLayer bridge resolver — built-in registry and dynamic bridge loading for first-party and community database adapters

Readme


@semilayer/bridge-resolver

Built-in bridge registry for SemiLayer. Ships with first-party database adapters bundled, and provides a community contribution path: submit a PR here to add a new database, and once merged and published, SemiLayer automatically consumes it.

Installation

npm install @semilayer/bridge-resolver
# or
pnpm add @semilayer/bridge-resolver

Usage

import { resolveBridge } from '@semilayer/bridge-resolver'

const PostgresBridge = resolveBridge('@semilayer/bridge-postgres')
const bridge = new PostgresBridge({ url: process.env.DATABASE_URL })
await bridge.connect()

Adding a New Database (Community Contributions)

The PR path is the primary way to add a new database to SemiLayer. Once your PR is merged here and a new version of @semilayer/bridge-resolver is published, SemiLayer automatically picks it up on its next release — every SemiLayer user gets your bridge for free, no extra setup required.

The flow:

  1. Write your bridge as its own npm package (e.g. @acme/bridge-mysql) — see the Bridge Authoring Guide for the interface and the @semilayer/bridge-sdk compliance test suite
  2. Publish your package to npm
  3. Open a PR to this repo that:
    • Adds your package as a dependency in package.json
    • Imports it and registers it in BUILT_IN_BRIDGES in src/index.ts
    • Adds a row to the "Built-in Bridges" table below
  4. CI runs the test suite + your bridge registration test
  5. The SemiLayer team reviews: code quality, security audit, license (MIT or Apache 2.0), maintenance commitment
  6. Merged → release-please opens a Release PR → new version of @semilayer/bridge-resolver published to npm
  7. SemiLayer's next release pulls in the new version — your bridge is live

See CONTRIBUTING.md for the detailed PR checklist.

API

resolveBridge(name): BridgeConstructor

Looks up a bridge by name. Checks custom runtime registrations first, then built-in bridges. Throws if no bridge matches.

registerBridge(name, ctor): void

Registers a bridge constructor at runtime under a name. Used for private/enterprise bridges that won't be submitted upstream — custom code specific to your deployment.

import { registerBridge } from '@semilayer/bridge-resolver'
import { MyInternalBridge } from './my-bridge.js'

// Call at worker startup, before first ingest job
registerBridge('@internal/bridge-custom', MyInternalBridge)

Custom runtime registrations take priority over built-ins with the same name — useful for testing or overriding behavior.

listBridges(): string[]

Returns all registered bridge names (built-in + custom), deduplicated.

clearCustomBridges(): void

Removes all runtime-registered bridges. Built-in bridges remain. Primarily useful in tests.

Built-in Bridges

| Name | Package | Database | |------|---------|----------| | @semilayer/bridge-postgres | @semilayer/bridge-postgres | PostgreSQL (and wire-compatible variants — Neon, Supabase, CockroachDB, ...) |

New bridges are added via community PRs — see above.

Requirements

  • Node.js 22+
  • @semilayer/core (peer-compatible version)
  • @semilayer/bridge-postgres (bundled as a dependency)

Links

License

MIT © SemiLayer