Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbakers/ipfs-storage
IPFS storage API providers.
https://github.com/alexbakers/ipfs-storage
filebase fleek ipfs ipfs-api ipfs-protocol ipfs-web lighthouse pinata storage web3 web3storage
Last synced: 5 days ago
JSON representation
IPFS storage API providers.
- Host: GitHub
- URL: https://github.com/alexbakers/ipfs-storage
- Owner: alexbakers
- License: mit
- Created: 2022-10-14T01:35:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-21T16:09:55.000Z (almost 2 years ago)
- Last Synced: 2024-12-03T15:09:25.166Z (22 days ago)
- Topics: filebase, fleek, ipfs, ipfs-api, ipfs-protocol, ipfs-web, lighthouse, pinata, storage, web3, web3storage
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ipfs-storage
- Size: 71.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# IPFS STORAGE API PROVIDERS
- [x] Filebase [filebase.com]
- [x] Fleek [fleek.co]
- [x] Web3 [web3.storage]
- [x] Pinata [pinata.cloud]
- [x] Lighthouse [lighthouse.storage]## Examples
### FILEBASE
```javascript
fs.readFile(join(__dirname, "..", "banner.png"), async (err, data) => {
if (err) {
console.log("🆘 ERROR:", err);
return;
}if (!process.env.FILEBASE_KEY) {
console.log("🆘 ERROR:", "Create .env file");
return;
}try {
const url = await uploadFile.filebase(
{
key: process.env.FILEBASE_KEY,
secret: process.env.FILEBASE_SECRET,
bucket: process.env.FILEBASE_BUCKET,
},
{
hash: "banner",
ext: ".png",
buffer: data,
}
);
console.log("✅ FILEBASE:", url);
await deleteFile.filebase(
{
key: process.env.FILEBASE_KEY,
secret: process.env.FILEBASE_SECRET,
bucket: process.env.FILEBASE_BUCKET,
},
{
hash: "banner",
ext: ".png",
}
);
} catch (err) {
console.log("🆘 FILEBASE:", err);
}
});
```### PINATA
```javascript
fs.readFile(join(__dirname, "..", "banner.png"), async (err, data) => {
if (err) {
console.log("🆘 ERROR:", err);
return;
}if (!process.env.PINATA_JWT) {
console.log("🆘 ERROR:", "Create .env file");
return;
}try {
const url = await uploadFile.pinata(
{
jwt: process.env.PINATA_JWT,
},
{
hash: "banner",
ext: ".png",
buffer: data,
}
);
console.log("✅ PINATA:", url);
await deleteFile.pinata(
{
jwt: process.env.PINATA_JWT,
},
{
url,
}
);
} catch (err) {
console.log("🆘 PINATA:", err);
}
});
```### FLEEK
```javascript
fs.readFile(join(__dirname, "..", "banner.png"), async (err, data) => {
if (err) {
console.log("🆘 ERROR:", err);
return;
}if (!process.env.FLEEK_KEY) {
console.log("🆘 ERROR:", "Create .env file");
return;
}try {
const url = await uploadFile.fleek(
{
key: process.env.FLEEK_KEY,
secret: process.env.FLEEK_SECRET,
bucket: process.env.FLEEK_BUCKET,
},
{
hash: "banner",
ext: ".png",
buffer: data,
}
);
console.log("✅ FLEEK:", url);
await deleteFile.fleek(
{
key: process.env.FLEEK_KEY,
secret: process.env.FLEEK_SECRET,
bucket: process.env.FLEEK_BUCKET,
},
{
hash: "banner",
ext: ".png",
}
);
} catch (err) {
console.log("🆘 FLEEK:", err);
}
});
```### WEB3
```javascript
fs.readFile(join(__dirname, "..", "banner.png"), async (err, data) => {
if (err) {
console.log("🆘 ERROR:", err);
return;
}if (!process.env.WEB3_TOKEN) {
console.log("🆘 ERROR:", "Create .env file");
return;
}try {
const url = await uploadFile.web3(
{
token: process.env.WEB3_TOKEN,
},
{
hash: "banner",
ext: ".png",
buffer: data,
}
);
console.log("✅ WEB3:", url);
await deleteFile.web3(
{
token: process.env.WEB3_TOKEN,
},
{
url,
}
);
} catch (err) {
console.log("🆘 WEB3:", err);
}
});
```### LIGHTHOUSE
```javascript
fs.readFile(join(__dirname, "..", "banner.png"), async (err, data) => {
if (err) {
console.log("🆘 ERROR:", err);
return;
}if (!process.env.LIGHTHOUSE_TOKEN) {
console.log("🆘 ERROR:", "Create .env file");
return;
}try {
const url = await uploadFile.lighthouse(
{
token: process.env.LIGHTHOUSE_TOKEN,
},
{
hash: "banner",
ext: ".png",
buffer: data,
}
);
console.log("✅ LIGHTHOUSE:", url);
await deleteFile.lighthouse(
{
token: process.env.LIGHTHOUSE_TOKEN,
},
{
url,
}
);
} catch (err) {
console.log("🆘 LIGHTHOUSE:", err);
}
});
```---
`(c)` Alex Baker