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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@keyrxng/ez-web3-rpc

v0.1.10

Published

Pragmatic RPC tooling for EVM stacks — discover, measure, and wrap JSON-RPC providers with latency-aware selection, retries, and optional consensus helpers.

Readme

ez-web3-rpc — pragmatic RPC tooling for EVM stacks

providers chains

🚀 Ready out of the box — 4,719 RPC providers across 2,332 chains

Small, pragmatic helpers to make working with Ethereum (Web3) JSON-RPC providers less tedious.

If your dapp, CI or infra depends on reliable chain reads/writes, this library helps you spend less time chasing flaky RPCs and copy/pasting from chainlist.

Why this exists:

  • You shouldn't need to manually curate lists of public RPC URLs or rewrite retry/consensus logic for every project.
  • This library keeps those concerns isolated: discover, measure, and wrap providers so your code sees a single stable, latency-ordered provider.

What you'll get:

  • Fewer production incidents from transient RPC failures — calls are raced and retried in an orderly way.
  • Faster warmup and more consistent latency because the handler prefers endpoints that proved faster for your network.
  • Safer reads for critical checks — optional consensus helpers let you compare multiple endpoints before trusting a value.
  • Minimal cognitive overhead — sensible defaults so you can get a working provider in seconds and tweak only if needed.

If that sounds useful, the rest is small glue to make it simple to adopt.

Badges npm version npm downloads license

Install

Install like any other npm package:

npm install @keyrxng/ez-web3-rpc
# or
yarn add @keyrxng/ez-web3-rpc

Requires Node >= 20.10 (uses global fetch & AbortController).

Quick start

This shows the minimal path from nothing to an RPC you can call.

import { RPCHandler } from '@keyrxng/ez-web3-rpc';

const handler = new RPCHandler({ networkId: '1' });
await handler.init();
const provider = handler.getProvider();
const block = await provider.send('eth_blockNumber', []);
console.log('block', parseInt(block));

That's it — you now have a provider that prefers healthy, low-latency endpoints and will retry intelligently on transient failures.

When to use it

  • CI jobs validating blocks or state where a single flaky RPC would cause false negatives.
  • Small services that can't afford bespoke provider orchestration but need reliable reads.
  • Local tooling and reporters that want consistent latency characteristics without manual tuning.

Core ideas (short)

  • Measure: probe candidates and prefer endpoints that are in-sync and fast.
  • Wrap: proxy provider calls so they race a small batch of endpoints and fall back cleanly.
  • Consensus (opt-in): compare multiple successful responses for reads you can't blindly trust.

Configuration highlights

Only networkId is required. Defaults are conservative so you get something useful quickly.

  • strategy: pick endpoints (default fastest) or choose firstHealthy for faster initial success.
  • settings.tracking: filter endpoints by declared tracking level (none / limited / yes).
  • settings.networkRpcs: add custom/private URLs (useful for paid or local nodes).
  • proxySettings.rpcCallTimeout / retryCount / retryDelay: tune retry behavior when necessary.

For advanced details, the types and options are small and documented in the source.

Safety and privacy notes

  • The library respects declared tracking metadata on endpoints so you can avoid endpoints that advertise heavy telemetry.
  • Consensus helpers are designed for reads; they intentionally won't try to form a quorum from only a single RPC.

Troubleshooting & errors

Common situations you'll see (and what they mean):

  • "Provider not initialized": call init() before using the handler.
  • "No RPC available": all probes timed out or failed — check your network/override RPCs.
  • Retry exhaustion: all batches failed after configured retries.

Logs are deliberately conservative; set settings.logLevel to debug or verbose only while diagnosing.

Contributing

Patches welcome. If you open a PR, keep the surface area small and tests passing.

Quick dev commands:

yarn install
yarn test:anvil # required in separate terminal
yarn test

License

MIT