Skip to content

cnpm/cos-cnpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cos-cnpm

fs storage wrapper for cnpm

Installation

$ npm install cos-cnpm

Warning!!!

Only support singleton. Don't initialize two cos-cnpm instance.

Usage

import COSClient from 'cos-cnpm';

config.nfs = {
  client: new COSClient({
    secretId: '',
    secretKey: '',
    bucket: '',
    region: '',
  }),
  // dir: join(config.dataDir, 'nfs'),
};

API

All the APIs are following cnpm nfs guide.

  • upload: upload a file from filepath

  • uploadBuffer: upload a file from buffer

  • download: download file by key

  • remove: remove file by key

  • uploadBytes: upload bytes

  • appendBytes: append bytes

  • readBytes: read bytes

  • list: list files by prefix

  • url: get download url

  • urls: get download urls

License

MIT

About

tencent-cloud cos wrapper for cnpm

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •