1.0.3 • Published 3 days ago
ipfs-node v1.0.3
IPFS Node
ipfs-node is a typescript library that simplifies the use of IPFS based on typescript using the helia and kubo-rpc-client library.
Installation:
This library requires running access to the IPFS Kubo daemon server API.
npm install ipfs-node
#OR
yarn add ipfs-node
#OR
pnpm add ipfs-node
Example:
const ipfsNode = RunIpfsNode.run();
const buffer = Buffer.from(new TextEncoder().encode('Hello world!'));
const { cid } = await ipfsNode.push(buffer);
const res = await ipfsNode.fetch(cid);
if (res.toString() !== buffer.toString()) throw new Error('> Test fail!');
console.log('> Test passed successfully.', cid);
A full example of using the repository can be found here ipfs-node-examples.
Usage
I strongly recommend using this module separately from the main application using the microservices structure. For example, you can create RPC when using IPFS nodes.
License
Licensed under MIT (LICENSE / http://opensource.org/licenses/MIT)