dumpToCar

@twine-protocol/twine-car-utils v0.0.3Docs


twine-js / @twine-protocol/twine-car-utils / dumpToCar

Function: dumpToCar()

dumpToCar(resolver): AsyncIterable<Uint8Array>

Dump all resolvable chains to a CARv2 file.

Parameters

Parameter
Type

resolver

Resolver

Returns

AsyncIterable<Uint8Array>

Example

// You can output the car to a file with:
import { pipeline } from 'node:stream/promises'
import { createWriteStream } from 'node:fs'
await pipeline(
  dumpToCar(resolver),
  createWriteStream(path)
)

Defined in

index.ts:104

Last updated