# bsv-minimal

> Parse raw bitcoin block and transaction buffers with minimal overhead

Latest version **3.0.1** (published 2026-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install bsv-minimal
pnpm add bsv-minimal
yarn add bsv-minimal
bun add bsv-minimal
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2026-04-21 |
| First published | 2019-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 161.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Kevin Johnson |
| Maintainers | kevinejohn |
| Keywords | bitcoin, BSV, BTC, BCH, XEC, segwit, blocks, block, blockchain, transaction, parse |

## Links

- npm: https://www.npmjs.com/package/bsv-minimal
- Repository: https://github.com/kevinejohn/bsv-minimal
- Homepage: https://github.com/kevinejohn/bsv-minimal#readme
- Issues: https://github.com/kevinejohn/bsv-minimal/issues
- npm.io page: https://npm.io/package/bsv-minimal

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2026-04-21
- 3.0.0 — 2026-04-21
- 2.0.1 — 2024-03-05
- 2.0.0 — 2023-10-25
- 1.2.1 — 2023-05-09
- 1.2.0 — 2023-05-09
- 1.1.4 — 2023-01-30
- 1.1.3 — 2023-01-30
- 1.1.2 — 2022-10-04
- 1.1.1 — 2022-09-28
- 1.1.0 — 2022-09-28
- 1.0.7 — 2022-09-27
- 1.0.6 — 2022-09-26
- 1.0.4 — 2022-09-26
- 1.0.3 — 2022-09-26
- … 44 more at https://npm.io/package/bsv-minimal/versions

## README

# bsv-minimal

[![NPM Package](https://img.shields.io/npm/v/bsv-minimal.svg?style=flat-square)](https://www.npmjs.org/package/bsv-minimal)

Parse raw bitcoin block and transaction buffers with minimal overhead

## Note

You must use node.js v12+

### Install

`npm i bsv-minimal`

### Documentation

- [View detailed documentation here](docs/README.md)

### Basic use

```js
const { Block, Transaction, Header } = require('bsv-minimal')

const block = Block.fromBuffer(yourBlockBuffer)
block.getHash()
block.getTransactions()
block.getHeight()
await block.getTransactionsAsync(({ header, txs, finished }) => {
    for (const {index, tx, offset, size} of txs) {
        console.log(`tx ${tx.getTxid()}`)
    }
})

const header = Header.fromBuffer(yourHeaderBuffer)
header.getHash()

const transaction = Transaction.fromBuffer(yourTransactionBuffer)
transaction.getTxid()
transaction.getCoinbaseHeight()
```

### Tests

`npm run test`

---
_Source: https://npm.io/package/bsv-minimal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
