# fast-ipfs

> A set of tools for working with IPFS, optimized for speed and size

Latest version **0.3.0** (published 2023-04-13) · 0 weekly downloads

## Install

```sh
npm install fast-ipfs
pnpm add fast-ipfs
yarn add fast-ipfs
bun add fast-ipfs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-04-13 |
| First published | 2022-12-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nearvlad |

## Links

- npm: https://www.npmjs.com/package/fast-ipfs
- npm.io page: https://npm.io/package/fast-ipfs

## Dependencies (1)

- [multibase](https://npm.io/package/multibase.md) ^4.0.6

## Recent versions

- 0.3.0 (latest) — 2023-04-13
- 0.2.0 — 2023-01-14
- 0.1.0 — 2023-01-07
- 0.0.1 — 2022-12-24

## README

# fast-ipfs

The goal of this project is to provide a set of tools to make it easy to use IPFS. Optimized for speed, ease of use and size (uses minimum dependencies).

It generally tries to avoid using the IPFS core modules and instead uses the lower level modules to provide a more flexible and faster alternative.

## Installation

```bash
npm install fast-ipfs
```

## Usage

Read a CAR file and print out the blocks

```js

    const fileData = await require('fs').promises.readFile(carFile);
    const blocks = readCAR(fileData);

    const header = blocks.shift();

    for (let block of blocks) {
        const { blockLength, data, startOffset } = block;
        console.log(`\nBlock at offset ${startOffset} with length ${blockLength}`);

        const blockInfo = readBlock(data);
        validateBlock(blockInfo.cid, blockInfo.data);

        console.log('Codec:', '0x' + blockInfo.codec.toString(16));
        console.log('CID:', cidToString(blockInfo.cid));
        if (blockInfo.node && blockInfo.node.links.length > 0) {
            console.log('Links:');
            for (let link of blockInfo.node.links) {
                console.log(`   ${link.name} (${link.size}) -> ${cidToString(link.cid)}`);
            }
        }
    }
```

Note that this is also available as ready to use script:

```bash
node ./scripts/dump-car.js <car file>
```


## Who uses it?

- [web4-deploy](https://github.com/vgrichina/web4-deploy) - deploy your web4 dapp using NEAR and IPFS. Uses `fast-ipfs` to read CAR files and upload to NEARFS.
- [nearfs](https://github.com/vgrichina/nearfs) - NEARFS is a file system that uses NEAR blockchain as a storage. Uses `fast-ipfs` to parse IPFS blocks.

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