open-index/open-npm huggingface dataset:
npm package: @rpckit/cluster
Description: Cluster meta-transport for rpckit with m-of-n quorum consensus
Author: mainnet_pat
Latest version: 2.0.0

# @rpckit/cluster

Cluster meta-transport for rpckit. Provides m-of-n quorum consensus across multiple transports.

## Installation

```bash
npm install @rpckit/core @rpckit/cluster
```

## Usage

```typescript
import type { ElectrumCashSchema } from '@rpckit/core/electrum-cash'
import { cluster } from '@rpckit/cluster'
import { webSocket } from '@rpckit/websocket'

const transport = cluster<ElectrumCashSchema>(
  [
    webSocket('wss://server1.example.com:50004'),
    webSocket('wss://server2.example.com:50004'),
    webSocket('wss://server3.example.com:50004'),
  ],
  { quorum: 2, timeout: 10000 }, // Require 2-of-3 agreement
)

await transport.connect()

// Only resolves when 2 servers return identical results
const tip = await transport.request('blockchain.headers.get_tip')

await transport.close()
```

## Options

- `quorum` - Number of identical responses required (must be ≥1 and ≤ number of transports)
- `timeout` - Timeout in ms for quorum to be reached

## How It Works

1. Request is sent to all transports in parallel
2. Responses are compared using deep equality
3. When `quorum` transports return identical results, that result is returned
4. If quorum cannot be reached (too many errors or different results), an error is thrown

Subscriptions also support quorum - notifications are only forwarded when enough transports agree.

## Response Observation

Monitor all requests and responses from individual transports:

```typescript
const unsub = transport.onResponse(({ method, params, transport, response, error, status }) => {
  console.log(`${method} via ${transport.url}: ${status}`)
})
// Later: unsub()

// Access underlying transports
console.log(transport.transports)
```
npm package: @rpckit/http
Description: HTTP transport for rpckit with request batching
Author: mainnet_pat
Latest version: 2.0.0

# @rpckit/http

HTTP transport for rpckit. Stateless JSON-RPC over HTTP POST with request batching.

## Installation

```bash
npm install @rpckit/core @rpckit/http
```

## Usage

```typescript
import { http } from '@rpckit/http'

const transport = http('https://example.com/rpc', {
  headers: { 'Authorization': 'Bearer token' }
})

const result = await transport.request('my.method', ['param1'])
await transport.close()
```

## Electrum Cash Variant

For Electrum Cash servers, use the `electrum-cash` subpath which pre-configures the `Server-Version` header:

```typescript
import { http } from '@rpckit/http/electrum-cash'

const transport = http('https://electrum.example.com')
const tip = await transport.request('blockchain.headers.get_tip')
```

The electrum-cash variant also accepts:

- `clientName` - Client name sent in Server-Version header (default: `'rpckit'`)
- `protocolVersion` - Protocol version (default: `'1.6'`)

## Ethereum Variant

For Ethereum JSON-RPC nodes, use the `ethereum` subpath:

```typescript
import { http } from '@rpckit/http/ethereum'

const transport = http('https://ethereum-rpc.publicnode.com')

const blockNumber = await transport.request('eth_blockNumber')
const balance = await transport.request('eth_getBalance', ['0x...', 'latest'])
```

## Options

- `timeout` - Request timeout in ms
- `headers` - Custom HTTP headers
- `retryCount` - Max retry attempts (default: 3)
- `retryDelay` - Base delay between retries in ms (default: 150, exponential backoff applied)
- `batch` - `true` (default), `false`, or `{ wait, batchSize, disabledCooldown }`
- `fetchFn` - Custom fetch implementation (e.g., `node-fetch`, `undici`)
- `fetchOptions` - Extra options passed to fetch (excluding `method`, `headers`, `body`, `signal`)
- `onRequest` - Callback before each request: `({ url, body }) => void`
- `onResponse` - Callback after each response: `({ status, body }) => void`
- `raw` - Return full RPC response objects instead of unwrapping results (default: `false`)

## Raw Mode

When `raw: true`, responses include the full JSON-RPC envelope:

```typescript
const transport = http('https://example.com', { raw: true })

const response = await transport.request('server.version')
// { jsonrpc: '2.0', result: ['Server', '1.4'], id: 1 }

// Errors are returned as results instead of thrown:
// { jsonrpc: '2.0', error: { code: -1, message: '...' }, id: 2 }
```

## Note

HTTP transport does not support subscriptions. Use WebSocket or TCP for subscription methods.
npm package: @rpdds/vue-at
Description: vue3版本的vue-at
Author: liushuai
Latest version: 1.0.11

# `vue-at`

## Usage

````javascript
// 全局样式引入：
@import '@rpdds/vue-at/dist/bundle.css';
// 页面中使用组件：
import { At, AtTa } from '@rpdds/vue-at'
// 其他使用方法同vue-at
````
npm package: @rpdf/fns
Description: React-pdf helper functions
Author: Mendy Landa
Latest version: 3.1.2

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/fns

> React-pdf helper functions

## How to install

```sh
yarn add @rpdf/fns
```
npm package: @rpdf/font
Description: Register font and emoji source for react-pdf document
Author: Mendy Landa
Latest version: 4.0.3

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/font
npm package: @rpdf/image
Description: Parses the images in png or jpeg format for react-pdf document
Author: Mendy Landa
Latest version: 3.0.3

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/image
npm package: @rpdf/layout
Description: Resolve document component's layout
Author: Mendy Landa
Latest version: 4.4.1

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/layout
npm package: @rpdf/pdfkit
Description: A PDF generation library for Node.js
Author: Devon Govett
Latest version: 4.1.0

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/pdfkit

A JavaScript PDF generation library for Node and the browser.

## Acknowledges

This project is a fork of [pdfkit](https://github.com/foliojs/pdfkit) by @devongovett and continued under the scope of this project since it has react-pdf specific features. Any recongnition should go to him and the original project mantainers.

## Description

PDFKit is a PDF document generation library for Node and the browser that makes creating complex, multi-page, printable documents easy.
It's written in CoffeeScript, but you can choose to use the API in plain 'ol JavaScript if you like. The API embraces
chainability, and includes both low level functions as well as abstractions for higher level functionality. The PDFKit API
is designed to be simple, so generating complex documents is often as simple as a few function calls.

Check out some of the [documentation and examples](http://pdfkit.org/docs/getting_started.html) to see for yourself!
You can also read the guide as a [self-generated PDF](http://pdfkit.org/docs/guide.pdf) with example output displayed inline.
If you'd like to see how it was generated, check out the README in the [docs](https://github.com/devongovett/pdfkit/tree/master/docs)
folder.

You can also try out an interactive in-browser demo of PDFKit [here](http://pdfkit.org/demo/browser.html).

## Installation

Installation uses the [npm](http://npmjs.org/) package manager. Just type the following command after installing npm.

    npm install @rpdf/pdfkit

## Features

- Vector graphics
  - HTML5 canvas-like API
  - Path operations
  - SVG path parser for easy path creation
  - Transformations
  - Linear and radial gradients
- Text
  - Line wrapping
  - Text alignments
  - Bulleted lists
- Font embedding
  - Supports TrueType (.ttf), OpenType (.otf), WOFF, WOFF2, TrueType Collections (.ttc), and Datafork TrueType (.dfont) fonts
  - Font subsetting
  - See [fontkit](http://github.com/devongovett/fontkit) for more details on advanced glyph layout support.
- Image embedding
  - Supports JPEG and PNG files (including indexed PNGs, and PNGs with transparency)
- Annotations
  - Links
  - Notes
  - Highlights
  - Underlines
  - etc.

## Coming soon!

- Patterns fills
- Outlines
- PDF Security
- Higher level APIs for creating tables and laying out content
- More performance optimizations
- Even more awesomeness, perhaps written by you! Please fork this repository and send me pull requests.

## Documentation

For complete API documentation and more examples, see the [PDFKit website](http://pdfkit.org/).

## License

PDFKit is available under the MIT license.
npm package: @rpdf/png-js
Description: A PNG decoder in JS
Author: Devon Govett
Latest version: 3.0.0

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/png-js

A PNG decoder in JS for the canvas element or Node.js.

## Acknowledges

This project is a fork of [png.js](https://github.com/foliojs/png.js) by @devongovett and continued under the scope of this project since it has react-pdf specific features. Any recongnition should go to him and the original project mantainers.

## About this fork

> Updated to 977b857a11676c1e720e79ed8d9178a005a9abd6

- Build node and browser specific bundles
- Uses rollup for build

## Browser Usage

Simply include png.js and zlib.js on your HTML page, create a canvas element, and call PNG.load to load an image.

    <canvas></canvas>
    <script src="zlib.js"></script>
    <script src="png.js"></script>
    <script>
        var canvas = document.getElementsByTagName('canvas')[0];
        PNG.load('some.png', canvas);
    </script>

The source code for the browser version resides in `png.js` and also supports loading and displaying animated PNGs.

## Node.js Usage

Install the module using npm

    sudo npm install png-js

Require the module and decode a PNG

    import PNG from 'png-js';
    PNG.decode('some.png', function(pixels) {
        // pixels is a 1d array (in rgba order) of decoded pixel data
    });

You can also call `PNG.load` if you want to load the PNG (but not decode the pixels) synchronously. If you already
have the PNG data in a buffer, simply use `new PNG(buffer)`. In both of these cases, you need to call `png.decode`
yourself which passes your callback the decoded pixels as a buffer. If you already have a buffer you want the pixels
copied to, call `copyToImageData` with your buffer and the decoded pixels as returned from `decodePixels`.
npm package: @rpdf/primitives
Description: Define uninitialized elements
Author: Mendy Landa
Latest version: 4.1.1

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/primitives
npm package: @rpdf/reconciler
Description: Define uninitialized elements
Author: Mendy Landa
Latest version: 1.1.4

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/reconciler
npm package: @rpdf/stylesheet
Description: A styles engine for Node and the browser
Author: Mendy Landa
Latest version: 6.1.1

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/stylesheet

> React-pdf styles engine

## How to install

```sh
yarn add @rpdf/stylesheet
```

## How it works

```js
import stylesheet from '@rpdf/stylesheet';

const container = {
  width: 400,
  height: 600,
  orientation: 'portrait',
};

const style = {
  margin: 20,
  width: '50vw',
  height: '20vh',
  borderRadius: 5,
  fontWeight: 'semibold',
  borderBottom: '2 solid yellow',
  '@media max-width: 500': {
    backgroundColor: 'rgb(255, 0, 0)',
  },
};

const computed = stylesheet(container, style);

// Computed
// {
//   width: 200,
//   height: 120,
//   marginTop: 20,
//   marginLeft: 20,
//   marginRight: 20,
//   marginBottom: 20,
//   marginBottom: 20,
//   borderTopLeftRadius: 5,
//   borderTopRightRadius: 5,
//   borderBottomLeftRadius: 5,
//   borderBottomRightRadius: 5,
//   fontWeight: 600,
//   borderBottomWidth: 2,
//   borderBottomStyle: 'solid',
//   borderBottomColor: 'yellow',
//   backgroundColor: '#FF0000'
// }
```

This library exports a `stylesheet` function that takes two arguments:

- _container_: Container where the styles are being computed into. It specifies the `width` and `height` in points (needed for media queries and unit conversions), and optionally the container `orientation` (needed for certain media queries).
- _style_: Style to be computed. JS object with raw styles that you would like to get in a normalized format.

## License

MIT © [Diego Muracciole](http://github.com/diegomura)
npm package: @rpdf/textkit
Description: An advanced text layout framework
Latest version: 6.0.0

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/textkit

## Acknowledges

This project is a fork of [textkit](https://github.com/foliojs/textkit) by @devongovett and continued under the scope of this project since it has react-pdf specific features. Any recongnition should go to him and the original project mantainers.

## Layout process

1. split into paragraphs
2. get bidi runs and paragraph direction
3. font substitution - map to resolved font runs
4. script itemization
5. font shaping - text to glyphs
6. line breaking
7. bidi reordering
8. justification
9. get a list of rectangles by intersecting path, line, and exclusion paths
10. perform line breaking to get acceptable break points for each fragment
11. ellipsize line if necessary
12. bidi reordering
13. justification
npm package: @rpdf/types
Description: React-pdf TypeScript definitions
Author: Mendy Landa
Latest version: 2.9.1

<p align="center">
  <img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
</p>

# @rpdf/types

> React-pdf TypeScript definitions

## How to install

```sh
yarn add @rpdf/types
```

## License

MIT © [Diego Muracciole](http://github.com/diegomura)