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

@beblurt/blurt-rpc-core

v0.1.0

Published

Generic JSON-RPC 2.0 core for transports, retries, endpoint pools, hooks and observability.

Readme

blurt-rpc-core

Generic JSON-RPC 2.0 core for TypeScript projects.

This package is intentionally domain-agnostic. It provides implemented primitives for:

  • JSON-RPC requests and responses;
  • a RpcClient facade for single calls, raw calls, notifications and batches;
  • fetch-based HTTP transport with timeout and abort support;
  • retries and backoff;
  • endpoint pools and selection strategies;
  • ordered lifecycle hooks;
  • generic metrics;
  • optional explicit cache;
  • structured public errors;
  • testing helpers.

It does not implement blockchain logic, health checks, scoring, cryptographic signatures, chain validation or MCP server behavior.

Status

MVP implemented. The core is usable as a generic JSON-RPC engine and is covered by unit tests for client orchestration, transport, retry/failover, node-pool selection, cache, hooks, metrics and structured errors.

Install

npm install @beblurt/blurt-rpc-core

The package is ESM-only, targets Node.js >= 18, and also runs in browser runtimes that provide fetch, AbortController, URL and setTimeout.

Scripts

npm run build
npm run typecheck
npm run lint
npm test
npm audit --audit-level=high

Minimal usage

import { RpcClient } from '@beblurt/blurt-rpc-core'

const rpc = new RpcClient('https://rpc.example.org', { timeoutMs: 4000 })
const result = await rpc.call('namespace.method', { limit: 10 })

Raw responses

const response = await rpc.call('namespace.method', { limit: 10 }, { responseMode: 'response' })

Multiple endpoints and retry/failover

import { fixedBackoff, RpcClient } from '@beblurt/blurt-rpc-core'

const rpc = new RpcClient(['https://rpc-a.example.org', 'https://rpc-b.example.org'], {
  retry: { maxAttempts: 3, backoff: fixedBackoff(250) }
})

const value = await rpc.call('namespace.method')

Explicit cache

Caching is never implicit and the core never decides cacheability from method names.

import { MemoryCacheProvider, RpcClient } from '@beblurt/blurt-rpc-core'

const rpc = new RpcClient('https://rpc.example.org', {
  cache: { provider: new MemoryCacheProvider(), ttlMs: 5000 }
})

await rpc.call('namespace.method', { limit: 10 }, { cache: { ttlMs: 5000 } })

Hooks and metrics

import { InMemoryMetricsCollector, RpcClient } from '@beblurt/blurt-rpc-core'

const metrics = new InMemoryMetricsCollector()
const rpc = new RpcClient('https://rpc.example.org', {
  metrics,
  hooks: {
    beforeRequest: (request, context) => {
      // Return a replacement request to mutate, or void to continue unchanged.
    },
    afterAttempt: (outcome) => {
      // Observe success/error for each concrete attempt.
    }
  }
})

Documentation

Start with:

  • ARCHITECTURE.md
  • API.md
  • DESIGN_DECISIONS.md
  • docs/public-api.md
  • docs/release-0.1.0.md
  • module reference pages under docs/

Non-goals

No blockchain, scoring, signatures, health checks, method-specific behavior or MCP server code belongs in this package.