New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cere-ddc-sdk/file-storage

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cere-ddc-sdk/file-storage

File storage client

latest
Source
npmnpm
Version
2.16.1
Version published
Weekly downloads
36
-85.31%
Maintainers
1
Weekly downloads
 
Created
Source

@cere-ddc-sdk/file-storage

The package provides API for storing and reading large files to DDC

Installation

Using NPM:

npm install @cere-ddc-sdk/file-storage --save

Using yarn:

yarn add @cere-ddc-sdk/file-storage

Usage

A quick guide of how to upload a file to DDC TESTNET using the FileStorage API.

  • Create a FileStorage instance

    import * as fs from 'fs';
    import { FileStorage, File, TESTNET } from '@cere-ddc-sdk/file-storage';
    
    const bucketId = 1n;
    const seed = 'hybrid label reunion only dawn maze asset draft cousin height flock nation';
    const fileStorage = await FileStorage.create(seed, TESTNET);
    

    The account used to create the instance should have a positive balance, DDC deposit, and the bucket should be created in advance

  • Upload a file to DDC

    const filePath = './my-picture.jpg';
    const fileStats = fs.statSync(filePath);
    const fileStream = fs.createReadStream(filePath);
    const file = new File(fileStream, { size: fileStats.size });
    
    const fileCID = await fileStorage.store(bucketId, file);
    
    console.log('The uploaded file CID', fileCID)
    
  • That is it. You can open the file from your browser

    const fileUrl = `https://storage.testnet.cere.network/${bucketId}/${fileCID}`;
    
    console.log('The file URL', fileUrl);
    

Documentation

For more information about what this package provides, see API reference

License

Licensed under the Apache License

FAQs

Package last updated on 22 Oct 2025

Did you know?

Socket

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.

Install

Related posts