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

meridianjs

v0.3.4

Published

Meridian - A TypeScript-first SDK that enforces a single stable contract across all third-party API providers

Readme

Meridian

One contract. Every API.

Stripe returns {"error":{"type":"..."}}. OpenAI returns {"error":{"message":"..."}}. Razorpay returns something else entirely. Meridian normalizes all of it — errors, rate limits, pagination, retries — so your application never has to care which provider is behind a call.

npm version tests adapters contracts types license

npm install meridianjs

TypeScript-first · ESM · Node ≥ 20 · zero required runtime dependencies


The problem

Every third-party API has its own convention for rate-limit headers, pagination cursors, error codes, and retry signals. You end up writing the same glue code for every new provider — and when one goes down, your app goes down with it.

Meridian is a single layer between your app and every provider. You get the same normalized response shape, the same error type, the same retry and failover behavior — no matter which API is behind the call.


Quick start

import { Meridian } from "meridianjs";

const meridian = await Meridian.create({
  localUnsafe: true,
  providers: {
    openai:    { auth: { apiKey: process.env.OPENAI_KEY } },
    anthropic: { auth: { apiKey: process.env.ANTHROPIC_KEY } },
  },
});

// Define a service — your app calls "llm", never "openai" or "anthropic" directly.
const llm = meridian.service("llm", ["openai", "anthropic"]);

// OpenAI goes down at 2am. Meridian fails over to Anthropic in ~27ms.
// Your app doesn't change. Your on-call doesn't wake up.
const { data, meta } = await llm.post("/v1/chat/completions", { body: { ... } });

meta.rateLimit.remaining   // always normalized — same field, every provider
meta.pagination?.hasNext   // same
meta.trace.latency         // ms, always present
meta.trace.retries         // how many retries were needed
meta.trace.circuitBreaker  // CLOSED | OPEN | HALF_OPEN

Errors are always a MeridianError with .category, .retryable, and .retryAfter — no more parsing provider-specific shapes to decide whether to retry.


What Meridian normalizes

| | Raw providers | Through Meridian | |---|---|---| | Errors | Different shape per provider | MeridianError — always category, retryable, retryAfter | | Rate limits | Parse per provider | meta.rateLimit.remaining — always present | | Pagination | cursor / offset / link-header per provider | meta.pagination.hasNext — always present | | Retries | Write per provider | Exponential backoff, idempotency-safe, per-adapter classification | | Circuit breaking | Build yourself | Automatic, per-provider, wraps the retry loop | | Provider outage | Your app breaks | Automatic failover to the next healthy provider | | API drift | Silent breakage | meridian.schema.check() catches it before prod |


Features

Reliability

  • Failover — define a service with ordered fallback providers; Meridian routes around outages automatically
  • Retries — per-adapter classification of what's retryable; exponential backoff with full idempotency safety
  • Rate limiting — token-bucket per provider with adaptive backoff; shared cooldown across all replicas via RedisStateStorage so a 429 on one process backs off the whole fleet
  • Circuit breaker — per-provider; wraps the retry loop so 3 retries count as one logical failure, not three
  • Transactions — multi-provider sagas with compensating rollbacks

Observability & compliance

  • OpenTelemetry — one-line auto-instrumentation; exporter recipes for Datadog, Grafana, Honeycomb, New Relic
  • Schema drift detection — snapshot provider contracts and gate CI on breaking changes
  • Contract registry — versioned snapshots under .meridian/registry/, designed to be committed to git
  • Reliability replay — record outage timelines and re-render them locally for post-mortems
  • Policy engineblockPII, redact, denyCountries, allowedProviders, readOnly run before every request; no network round-trip on block
  • India / fintech — 13 Indian payment adapters, UPI helpers, Aadhaar/PAN/VPA redaction, DPDPA compliance mode

Language support

  • Polyglotdocker compose up -d starts the gRPC engine; pre-built clients for Go, Rust, and Python get all 47 providers with no Node.js on the host
  • CLImeridian add <provider> --openapi ./spec.json generates a fully-tested adapter from an OpenAPI spec
  • Pagination — cursor, offset, and link-header strategies; meta.pagination is always the same shape

Polyglot

One engine, any language — no Node.js required on the host:

cp .env.example .env    # set MERIDIAN_PROXY_TOKEN + provider credentials
docker compose up -d    # gRPC engine on 127.0.0.1:4242
// Go — same normalized shape for all 47 providers
c, _ := meridian.Dial(ctx, "127.0.0.1:4242", meridian.WithToken(token))
resp, _ := c.Get(ctx, "stripe", "/v1/customers")
# Python — including StreamCall for LLM token streaming
async with MeridianGrpcClient("127.0.0.1:4242", auth_token=token) as client:
    async for chunk in client.anthropic.stream_call("/v1/messages", body={...}):
        print(chunk.data, end="")

Go · Rust · Python clients ship in clients/. Generate one for C++, Java, C#, and more straight from proto/meridian.proto. See docs/polyglot.md.


Security

  • SSRF protection — every endpoint is validated as a relative path before a request is built; isSafeEndpoint() for untrusted input
  • Credential & PII redactionauthorization / token / cookie always scrubbed from logs and error payloads; opt-in PII coverage including Aadhaar, PAN, VPA in India mode
  • Webhook verification — timing-safe HMAC checks with timestamp freshness enforcement (matches Stripe's own 5-minute tolerance)
  • Zero required runtime dependencies — nothing in your supply chain you didn't ask for

See SECURITY.md for private vulnerability reporting.


Providers

47 adapters, each passing the same 19 contract invariants (1637 contract tests). Verify any one locally: npm run test:contracts stripe.

| Category | Providers | |---|---| | Payments | Stripe · Razorpay · Cashfree · PayU · Juspay · Braintree · Adyen · Klarna · Mollie · PhonePe · Checkout.com · BillDesk · CCAvenue | | AI / LLM | OpenAI · Anthropic · Gemini · Cohere · Mistral | | Communications | Twilio · SendGrid · Mailgun · Vonage · MSG91 · Exotel · Gupshup | | KYC / Identity | HyperVerge · Digio · Karza · IDfy · Setu · Decentro · Perfios | | Tools & Infra | GitHub · HubSpot · Supabase · Auth0 · Apollo · Hunter · S3 | | Mapping | Google Maps · MapMyIndia | | Observability | Sentry · Datadog | | Logistics | Shiprocket · Delhivery | | Other | Cleartax |

India fintech and compliance details: docs/fintech.md.


Contributing

New adapter: npx meridian add <name> --openapi ./spec.json → review GENERATED.mdnpm test.

Changelog · License: MIT · npm