How to use the cos-nodejs-sdk-v5.prototype function in cos-nodejs-sdk-v5

To help you get started, we’ve selected a few cos-nodejs-sdk-v5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tencentyun / scf-demo-repo / Node8.9_CosUnzipFile / common / utils.js View on Github external
function initCosInstance({ SecretId, SecretKey, XCosSecurityToken, ...args }) {
  const cosInstance = new COS({
    SecretId,
    SecretKey,
    XCosSecurityToken,
    ...args
  })

  const keys = Object.keys(COS.prototype)
  const noRetryKeys = ['getObject', 'putObject']

  appendFunction({
    target: cosInstance,
    keys: noRetryKeys,
    maxTryTime: 1
  })

  appendFunction({
    target: cosInstance,
    keys: keys.filter(key => !noRetryKeys.includes(key)),
    maxTryTime: 3
  })
  return cosInstance
}

cos-nodejs-sdk-v5

cos nodejs sdk v5

MIT
Latest version published 4 months ago

Package Health Score

70 / 100
Full package analysis