Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@thirdweb-dev/storage
Advanced tools
Best in class decentralized storage SDK for Browser and Node
Install the latest version of the SDK with either npm
or yarn
:
npm install @thirdweb-dev/storage
yarn add @thirdweb-dev/storage
Once you have the Thirdweb Storage SDK installed, you can use it to easily upload and download files and other data using decentralized storage systems.
Here's a simple example using the SDK to upload and download a file from IPFS:
import { ThirdwebStorage } from "@thirdweb-dev/storage";
// First, instantiate the SDK
const storage = new ThirdwebStorage();
// Now we can upload a file and get the upload URI
const file = readFileSync("path/to/file.jpg");
const uri = await storage.upload(file);
// Finally we can download the file data again
const res = await storage.download(uri);
const data = await res.text();
Alternatively, we can use the SDK to upload and download metadata and JSON objects, and we can also upload multiple items at once:
// We define metadata for 2 different NFTs
const metadata = [
{
name: "NFT #1",
description: "This is my first NFT",
image: readFileSync("path/to/file.jpg"),
properties: {
coolness: 100,
},
},
{
name: "NFT #2",
description: "This is my second NFT",
image: readFileSync("path/to/file.jpg"),
properties: {
coolness: 200,
},
},
];
// And now we can upload it all at once to a single directory
const uris = await storage.uploadBatch(metadata);
// And easily retrieve the metadata
const metadata = await storage.downloadJSON(uris);
You can learn more about thirdweb and the Storage SDK with the following resources:
FAQs
thirdweb Storage <a href
The npm package @thirdweb-dev/storage receives a total of 6,558 weekly downloads. As such, @thirdweb-dev/storage popularity was classified as popular.
We found that @thirdweb-dev/storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.