Miss any of our Open RFC calls?Watch the recordings here! »

cos-cnpm

1.0.1 • Public • Published

cos-cnpm

fs storage wrapper for cnpm

Installation

$ npm install cos-cnpm

Warning!!!

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

Usage

var client = require('cos-cnpm')({
  APPID: '',
  SECRET_ID: '',
  SECRET_KEY: '',
  bucket: 'tnpmnfs',
  
  // 从 https://github.com/tencentyun/cos-java-sdk-v5/blob/master/src/main/java/com/qcloud/cos/region/Region.java 中选择。默认是 cn-south 华南
  region: 'cn-south', 
})

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

License

MIT

Install

npm i cos-cnpm

DownloadsWeekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar