npm.io
0.1.2 • Published 3 years ago

wacz2car

Licence
Apache-2.0
Version
0.1.2
Deps
8
Size
269 kB
Vulns
0
Weekly
0
Stars
4

wacz2car

Conver WACZ files to CAR files for uploading to IPFS.

import {wacz2Car} from 'wacz2car'
import { createLoader } from '@webrecorder/wabac/src/blockloaders.js'

const loader = await createLoader({someURL})
const carStream = wacz2Car(loader)

for await (const chunk of stream.readable) {
  writeChunkToFile(chunk)
}

const rootCID = stream.finalBlock.cid