Socket
Socket
Sign inDemoInstall

@blueshit/cos-client

Package Overview
Dependencies
4
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @blueshit/cos-client

简单腾讯云COS客户端


Version published
Maintainers
2
Install size
75.1 kB
Created

Readme

Source

cos-client

腾讯云 COS 客户端

Install

const COSClient = require("@blueshit/cos-client").default;

const client = new COSClient({
  appId: "xxxxx",
  secretId: "xxxxx",
  secretKey: "xxxxx",
  bucket: "test",
  region: "ap-guangzhou",
  prefix: "test/",
});

// 通过 Buffer 上传
const data = fs.readFileSync("icon.png");
client.putObject("icon.png", data)
  .then(console.log)
  .catch(console.log);

// 通过 Stream 上传
const stream = fs.createReadStream("icon.png");
client.putObject("icon.png", stream)
  .then(console.log)
  .catch(console.log);

Keywords

FAQs

Last updated on 13 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc