# @atcute/car

> lightweight DASL CAR (content-addressable archives) codec for AT Protocol.

Latest version **6.1.0** (published 2026-09-24) · 0BSD license · 0 weekly downloads

## Install

```sh
npm install @atcute/car
pnpm add @atcute/car
yarn add @atcute/car
bun add @atcute/car
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2026-09-24 |
| First published | 2024-10-05 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 23.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 519 |
| Maintainers | externdefs |
| Keywords | atproto, car, dasl |

## Links

- npm: https://www.npmjs.com/package/@atcute/car
- Repository: https://tangled.org/did:plc:pljn5qch4tgadongtc7i6qij
- npm.io page: https://npm.io/package/@atcute/car

## Dependencies (4)

- [@atcute/cid](https://npm.io/package/@atcute/cid.md) ^2.5.0
- [@atcute/cbor](https://npm.io/package/@atcute/cbor.md) ^2.3.8
- [@atcute/varint](https://npm.io/package/@atcute/varint.md) ^2.0.2
- [@atcute/uint8array](https://npm.io/package/@atcute/uint8array.md) ^1.2.0

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 6.1.0 (latest) — 2026-09-24
- 6.0.2 — 2026-06-29
- 6.0.1 — 2026-06-15
- 6.0.0 — 2026-05-09
- 5.1.2 — 2026-05-08
- 5.1.1 — 2026-02-12
- 5.1.0 — 2026-01-15
- 5.0.0 — 2025-10-20
- 3.1.3 — 2025-10-14
- 3.1.2 — 2025-10-09
- 3.1.1 — 2025-05-24
- 3.1.0 — 2025-05-23
- 3.0.5 — 2025-05-17
- 3.0.4 — 2025-05-04
- 3.0.3 — 2025-04-22
- … 12 more at https://npm.io/package/@atcute/car/versions

## README

# @atcute/car

content-addressable archive (CAR) codec for AT Protocol.

```sh
npm install @atcute/car
```

this library implements DASL's [CAR][dasl-car] format used by AT Protocol to store and transfer
repository data.

[dasl-car]: https://dasl.ing/car.html

## usage

### streaming usage

```ts
import { fromStream } from '@atcute/car';

const stream = new ReadableStream({/* ... */});

await using car = fromStream(stream);

const roots = await car.roots();

for await (const entry of car) {
	entry;
	// ^? CarEntry { cid: CidLink {}, bytes: Uint8Array {}, ... }
}
```

### streaming usage (for runtimes without `await using` yet)

```ts
const car = fromStream(stream);

try {
	for await (const entry of car) {
		entry;
		// ^? CarEntry { ... }
	}
} finally {
	await car.dispose();
}
```

### sync usage

```ts
const buffer = Uint8Array.from([/* ... */]);

// read generic CAR archives
const car = fromUint8Array(buffer);

const roots = car.roots;

for (const entry of car) {
	entry;
	// ^? CarEntry { cid: CidLink {}, bytes: Uint8Array {}, ... }
}
```

### writing

```ts
import { writeCarStream } from '@atcute/car';

const blocks = async function* () {
	yield { cid: commitCid.bytes, data: commitBytes };
	yield { cid: nodeCid.bytes, data: nodeBytes };
};

for await (const chunk of writeCarStream([rootCid], blocks())) {
	stream.write(chunk);
}
```

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