2.0.1 • Published 3 years ago
cos-cnpm v2.0.1
cos-cnpm
fs storage wrapper for cnpm
Installation
$ npm install cos-cnpmWarning!!!
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 filepathuploadBuffer: upload a file from bufferdownload: download file by keyremove: remove file by keyuploadBytes: upload bytesappendBytes: append bytesreadBytes: read byteslist: list files by prefixurl: get download urlurls: get download urls
License
MIT