ipfs-web3storage-cid
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ipfs-web3storage-cid

Takes a file buffer and returns the IPFS CID v1 (Same as that generated by Web3.Storage)

A better way to name files and have it compatible with IPFS / Web3.Storage CIDs. Generally prefer this method over generating random UUIDs.

Install

# install it as a dependency
$ npm i ipfs-web3storage-cid

Usage

import fs from 'fs';
import { getCID } from 'ipfs-web3storage-cid';

const buffer = fs.readFileSync('./demo.jpg');

const cid = await getCID(buffer);

console.log(cid);

Package Sidebar

Install

npm i ipfs-web3storage-cid

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

2.24 kB

Total Files

6

Last publish

Collaborators

  • helloivanco