test-oss-prefix

0.0.13 • Public • Published

oss-cnpm

NPM version build status Test coverage David deps npm download

oss wraper for cnpmjs.org NFS

Usage

const oss = require('oss-cnpm');
 
const client = oss.create({
  accessKeyId: 'your id',
  accessKeySecret: 'your secret',
  // change to your endpoint
  endpoint: 'oss-cn-shenzhen.aliyuncs.com',
  bucket: 'your bucket',
  mode: 'public or private',
  prefix: 'subdir in your bucket',
});

Cluster mode

const oss = require('oss-cnpm');
 
const client = oss.create({
  mode: 'public or private',
  schedule: 'masterSlave or roundRobin', // defualt is masterSlave
  cdnBaseUrl: null, // set your custom cdn baseUrl, like `https://cdn.npm.taobao.org/`
  defaultHeaders: {
    'Cache-Control': 'max-age=0, s-maxage=86400',
  },
  cluster: [
    {
      accessKeyId: 'your id1',
      accessKeySecret: 'your secret1',
      endpoint: 'oss-cn-shenzhen.aliyuncs.com',
      bucket: 'your bucket1',
    },
    {
      accessKeyId: 'your id2',
      accessKeySecret: 'your secret2',
      endpoint: 'oss-cn-hangzhou.aliyuncs.com',
      bucket: 'your bucket2',
    },
  ],
});

Test keys

https://github.com/cnpm/oss-cnpm/wiki

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i test-oss-prefix

Weekly Downloads

1

Version

0.0.13

License

MIT

Unpacked Size

7.5 kB

Total Files

5

Last publish

Collaborators

  • xshhs23