Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjay-sol/npmpkg_getipfscid
This NPM package allows you to easily generate the IPFS hash of any file by providing your Web3Storage token and the file path.
https://github.com/sanjay-sol/npmpkg_getipfscid
ipfs web3storage
Last synced: 2 days ago
JSON representation
This NPM package allows you to easily generate the IPFS hash of any file by providing your Web3Storage token and the file path.
- Host: GitHub
- URL: https://github.com/sanjay-sol/npmpkg_getipfscid
- Owner: sanjay-sol
- Created: 2023-07-22T20:48:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-23T08:13:14.000Z (over 1 year ago)
- Last Synced: 2024-12-17T00:44:54.307Z (12 days ago)
- Topics: ipfs, web3storage
- Language: JavaScript
- Homepage:
- Size: 5.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IPFS cid Generator for any file
# Description
This NPM package allows you to easily generate the IPFS hash of any file by providing your Web3Storage token and the file path. It utilizes the "web3.storage" library to handle the file uploads to the InterPlanetary File System (IPFS) network through the Web3Storage service## Installation
You can install the package via NPM by running the following command:
```bash
npm install getipfscid
```## Usage
To use this package, you need to have a Web3Storage token.
Use the package manager [web3storage](https://web3.storage/) to generate a web3Storage token.
Here's an example of how to use the package in your code:
```js
import generateIPFSHash from 'getipfscid';async function main() {
try {
const token = "YOUR_WEB3STORAGE_TOKEN";
const folderLocation = "./path/to/your/file.txt";
const cid = await generateIPFSHash(token, folderLocation);
console.log("IPFS Hash (CID):", cid);
} catch (error) {
console.error(error.message);
}
}
```
## More Documentation[web3storage](https://web3.storage/)