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

electrs-client-node

v1.0.2

Published

A javascript client for communicating with [Blockstream's electrs](https://github.com/Blockstream/electrs) HTTP api

Readme

electrs-client-node

A javascript client for communicating with Blockstream's electrs HTTP api

import { Client } from "electrs-client-node";

const client = new Client({
  ELECTRUM_SERVER_URL: "http://localhost:30000",
});

Transactions

// GET a transaction
const tx = await client.transaction.get(txId);

// GET transaction status
const txStatus = await client.transaction.status(txId);

// GET transaction  hex
const hex = await client.transaction.hex(txId);

// GET transaction raw
const raw = await client.transaction.raw(txId);

// GET merkle inclusion proof(using bitcoind's merkleblock format)
const merkleBlockProof = await client.transaction.merkleBlockProof(txId);

// GET merkle inclusion proof( using Electrum's blockchain.transaction.get_merkle format)
const merkleProof = await client.transaction.merkleProof(txId);

// GET spending status of a transaction output
const spendingStatus = await client.transaction.outputSpend(txId, vout);

// GET spending status of all transaction output
const spendingStatus = await client.transaction.outputsSpend(txId);

// CREATE a transaction
const tx = await client.transaction.create(hex);

Addresses

// GET address information
const addressInfo = await client.address.getInfo(address);

// Get transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page.
const addressTransactions = await client.address.getTransactions(address);

// More can be requested by specifying the last txid seen by the previous query.
const moreTransactions = await client.address.getTransactions(address, lastSeenTxId);

// Get unconfirmed transaction history for the specified address/scripthash.
// Returns up to 50 transactions (no paging)
const mempoolTxs = await client.address.getMempoolTransactions(address);

// Get the list of unspent transaction outputs associated with the address
const utxos = await client.address.getUtxo(address);

// Search for addresses beginning with :prefix.
// Returns a JSON array with up to 10 results.
const addresses = await client.address.getByPrefix(address);

Blocks

// GET block information
const blockInfo = await client.block.get(blockHash);

// GET the hex-encoded block header.
const blockHeader = await client.block.getHeader(blockHash);

// GET the block status
const blockStatus = await client.block.getStatus(blockHash);

// Returns a list of transactions in the block (up to 25 transactions beginning)
const transactions = await client.block.getTransactions(blockHash);

// for a block with more than 25 transactions, the `startIndex`(which must be a multiple of 25 e.g 0, 25, 50, 75, 100 ... ) can be used for pagination.
const moreTransactions = await client.block.getTransactions(blockHash, startIndex);

// Returns list of all txids in the block
const transactionsIds = await client.block.getTransactionsIds(blockHash);

// Returns the transaction at index :index within the specified block.
const txIdAtIndex = await client.block.getTransactionIdAtIndex(blockHash, 1);

// Returns the hash of the block currently at height.
const hash = await client.block.getHash(height);

// Returns the 10 newest blocks starting at the tip or at start_height if specified.
const blocksList = await client.block.list();
const blocksListFromStartingHeight = await client.block.list(startHeight);

// Returns the height of the last block
const latestBlockHeight = await client.block.getLatestHeight();

// Returns the hash of the last block.
const latestBlockHash = await client.block.getLatestHash();

Mempool

// Get mempool backlog statistics.
const mempoolStats = await client.mempool.getStats();

// Get the full list of txids in the mempool as an array.
const mempoolTxIds = await client.mempool.getTxIds();

// Get a list of the last 10 transactions to enter the mempool.
const recentTxs = await client.mempool.getRecentTxs();

Fee

// GET fee-estimates
const feeEstimate = await client.fee.getEstimate();