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

@usebutr/core

v3.0.1

Published

Core types, store, storage, and discovery seam for butr. No React, no protocols.

Readme

@usebutr/core

Core types, store, storage, and discovery seam for butr. No React, no protocols.

Part of butr, a multi-chain wallet discovery and connection-state library. Your application owns the picker UI and chain client.

Install

npm install @usebutr/core zustand

The wallet manager works outside React. Pair it with @usebutr/wallets (or one platform's discover*Adapters) to find real wallets, or use @usebutr/react for the provider and hooks.

Usage

import { createWalletManager, fromAdapters } from "@usebutr/core";
import { autoDiscovery } from "@usebutr/wallets";

const manager = createWalletManager({
  onConnectError: (error, connectorId) => console.warn(connectorId, error.kind),
  sources: [autoDiscovery()],
});

// Creating a manager has no side effects; start() subscribes the sources,
// restores persisted connections once, and bridges wallet events.
const stop = manager.start();

const wallet = await manager.connect("io.metamask");

// A method exists only when it works for this wallet.
if (wallet.connector.signMessage) {
  await wallet.connector.signMessage(new TextEncoder().encode("hello"), {
    account: wallet.account,
  });
}

manager.subscribe((state) => console.log(state.pool.size, state.activeConnectorId));
  • Sources. A WalletSource is (onAdapter) => unsubscribe, so every discover*Adapters export goes into sources as-is. fromAdapters(adapters) wraps an array or a promise of built adapters (WalletConnect, Ledger, hand-rolled ones). The first adapter announced for an id wins.
  • State. getState() holds the discovered adapters, the live pool, the selection per platform, activeConnectorId, reconnectingIds, and the latest attempt's connectionStatus / connectionError.
  • Actions. connect, disconnect, disconnectAll, requestAccounts, setAccount, setActive, setSelection, clearConnectionError. connect resolves the ConnectedWallet and rejects with a ConnectionError whose kind is UserRejected, RequestPending, WalletLocked, ChainMismatch, NotConnected, Timeout, WalletNotFound or Unknown.
  • Signers. connector.getSigner() resolves a tagged WalletSigner; narrow it with switch (signer.kind). Each transport package registers its kind.
  • Chains and accounts. Every registry lives here (EVM_CHAINS, SVM_CHAINS, SUI_CHAINS, BITCOIN_CHAINS, POLKADOT_CHAINS, their *_LIST, CHAINS_BY_PLATFORM). Adapters build chains with resolveChain(id, list) and accounts with buildAccount(address, chain).

Persistence

Connections persist to localStorage and sessionStorage by default, written after every change once start-up hydration has read what was there. Swap the drivers with createWalletStorage({ persistent, session }) (for example createCookieStorageDriver() so a server can read them), or pass any WalletPersistence: an object with load() and save(state).

To render connections on the server, read the cookies with readWalletSnapshot(cookies) and pass the snapshot as createWalletManager(config, { initialState }). Seeded wallets render at once and stay in reconnectingIds until their silent reconnect lands.

Documentation

License

MIT, copyright 2026 Pedro Filho.