Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features: * Uses new JS UnixFS library to generate CARs. * All CLI commands now accept input on `stdin` and write to `stdout` by default. * In the CLI, CAR files streamed to disk are then updated to have correct root CID in header. * Due to streaming generation this library is now around 50% faster than the previous version. * Uses new https://github.com/web3-storage/car-block-validator library when unpacking. * Adds a `--no-verify` flag to disable * Ability to work with CAR files with no root CID in the CAR header by searching for "implicit" root CIDs in the blocks it contains. Removals: * The programmatic API for unpacking a CAR has been removed. * There's not really one good way to do this right now and not really a pure streaming version (the current `unpackStream` function buffers in memory) which doesn't feel in the spirit of this library anymore. All `unpack` does currently is take a `CarReader`, wrap it in a blockstore interface and give it directly to `ipfs-unixfs-exporter`, which isn't adding loads of value...so I just, removed it and recommended that people just use `@ipld/car` and `ipfs-unixfs-exporter` modules instead. We can always add it back if folks are desperate for it... Additional changes: * Switched to using `sade` for CLI * Updated CI to test on Node.js 18 & 19 * Switched to pure JS with no build/compile step * ESM only * Added coverage reporting and 100% line coverage with tests * Consolidated license files into single file BREAKING CHANGE: The programmatic API has changed significantly, see the README for new streaming API. The CLI "commands" like `--pack` have changed to `pack` (i.e. without dashes) but are largely very similar. In the CLI, CAR files written to stdout or piped to another program (i.e. not written to disk using `--output`) will not have a root CID in the CAR header. Minimum Node.js version for the CLI has changed to 18.
- Loading branch information