1.1.4 • Published 4 months ago

@mdip/ipfs v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

MDIP IPFS

MDIP utilities for integrating with IPFS.

Installation

npm install @mdip/ipfs

Usage

basic use

// Import using subpaths
import HeliaClient from '@mdip/ipfs/helia';

// Non-subpath import
import { HeliaClient } from '@mdip/ipfs';

const ipfs = new HeliaClient();

await ipfs.start();

const data = { data: 'whatever' };
const cid = await ipfs.addJSON(data);
const retrieve = await ipfs.getJSON(cid); // retrieve == data

await ipfs.stop();

create factory

The static factory method create can be used to create and start an IPFS instance:

const ipfs = await HeliaClient.create();

FS blockstore mode

Passing datadir in options to start or create will persist the data to the specified folder.

const ipfs = await HeliaClient.create({ datadir: 'data/ipfs' });

minimal mode

Starting IPFS in minimal mode avoids starting a Helia IPFS server. Only add works to generate CIDs. Nothing is persisted so get always throws a NotConnectedError.

const ipfs = await HeliaClient.create({ minimal: true });
1.1.4

4 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

6 months ago

1.0.0

8 months ago

0.6.0

9 months ago

0.5.0

10 months ago

0.4.0

11 months ago