npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wqcloud

v5.0.2

Published

ALL QCloud APIs

Downloads

19

Readme

WQCloud

比官方SDK更好用的腾讯云SDK。

已经疯狂得不能用代码行数(总计66行,包含空行和debug)来衡量该项目了,代码仅有 1,489字节(净化后)。

npm npm npm

Minimum, Flexible, Scalable.

支持Lazy Require。

Table of Contents generated with DocToc

安装和使用

国际惯例:

npm install wqcloud --save
# Node.js 7.6.0之前的版本请安装 v2.x.x版本
npm install [email protected] --save

公共参数:

var options = {
  SecretId: '',
  SecretKey: '',
  // 不填,每次请求都会自动重新生成
  // Signature: '',
  Nonce: parseInt(Math.random() * 999999, 10),
  Timestamp: parseInt(new Date() / 1000, 10)
};

ES5:

var WQCLOUD = require('wqcloud');
var trade = WQCLOUD.TRADE(options);
trade.DescribeUserInfo().then(function(instances){
  // xxxx
});

ES7:

const {TRADE} = require('wqcloud');
const trade = TRADE(options);
// Within Async Func
(async() => {
  const userInfo = await trade.DescribeUserInfo();
  // xxxx
})();

v2

默认使用的版本是 v3, 如果需要使用 V2 参考:

ES5:

var WQCLOUD = require('wqcloud');
var trade = WQCLOUD.V2.TRADE(options);
trade.DescribeUserInfo().then(function(instances){
  // xxxx
});

ES7:

const {V2:{ TRADE }} = require('wqcloud');
const trade = TRADE(options);
// Within Async Func
(async() => {
  const userInfo = await trade.DescribeUserInfo();
  // xxxx
})();

已支持的接口

云服务器 CVM

API文档参考:https://www.qcloud.com/document/api/213/568

查询可用区示例:

const WQCLOUD = require('wqcloud');

const example = WQCLOUD.CVM({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.DescribeAvailabilityZones({
  Region: 'gz'
}).then((data) => {
  console.log(data);
});

云硬盘 CBS

API文档参考:https://www.qcloud.com/document/api/362/2445

查询价格示例:

const example = WQCLOUD.CBS({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.InquiryStoragePrice({
  inquiryType: 'create',
  storageType: 'cloudBasic',
  storageSize: 100,
  goodsNum: 1,
  period: 1,
  payMode: 'prePay'
}).then((data) => {
  console.log(data);
});

黑石物理服务器 BM

API文档参考:https://www.qcloud.com/document/api/386/6628

查询可用区示例:

const example = WQCLOUD.BM({
  SecretId: 'xxx',
  SecretKey: 'xxx'
});

example.DescribeRegions().then((data) => {
  console.log(data);
});

弹性伸缩 SCALING

API文档参考:https://www.qcloud.com/document/api/377/3170

查询弹性伸缩组示例:

const example = WQCLOUD.SCALING({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.DescribeScalingGroup().then((data) => {
  console.log(data);
});

负载均衡 LB

API文档参考: https://www.qcloud.com/document/api/214/888

查询价格示例:

const example = WQCLOUD.LB({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.InquiryLBPrice({
  loadBalancerType: 2
}).then((data) => {
  console.log(data);
});

私有网络 VPC

API文档参考: https://www.qcloud.com/document/api/215/908

查询私有网络列表示例:

const example = WQCLOUD.VPC({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.DescribeVpcEx().then((data) => {
  console.log(data);
});

内容分发网络

API文档参考: https://www.qcloud.com/document/api/228/1722

查询所有域名信息示例:

const example = WQCLOUD.CDN({
  SecretId: 'xxxx',
  SecretKey: 'xxxx'
});

example.DescribeCdnHosts().then((data) => {
  console.log(data);
});

数据库 CDB

API文档参考: https://www.qcloud.com/document/api/236/1209

云解析 CNS

DNSPOD服务。

不得不说,DNSPOD是我见过最烂的服务商,客服电话永远打不通。交钱的是大爷,想要霸占别人域名只需要购买VIP服务即可,域名主人就别再想用DNSPOD的免费服务了。呵呵哒~

个人意见,强烈推荐参考。

API文档参考: https://www.qcloud.com/document/api/302/4031

数据库 TDSQL

API文档参考: https://www.qcloud.com/document/api/237/2246

数据库 SQLSERVER

API文档参考:https://www.qcloud.com/document/api/238/6430

弹性缓存 REDIS

API文档参考: https://www.qcloud.com/document/api/239/1748

弹性缓存 CMEM (Memcached)

API文档参考: https://www.qcloud.com/document/api/241/1762

网络安全 DAYU

API文档参考: https://www.qcloud.com/document/api/297/2314

天御业务安全防护 CSEC

API文档参考: https://www.qcloud.com/document/api/295/1773

云监控/自定义监控 MONITOR

API文档参考: https://www.qcloud.com/document/api/397/1785

云搜 YUNSOU

API文档参考: https://www.qcloud.com/document/api/270/1989

文智自然语言处理 WENZHI

API文档参考: https://www.qcloud.com/document/api/271/2049

账号相关 TRADE

API文档参考: https://www.qcloud.com/document/api/378/4367

获取账户余额示例:

const {TRADE} = require('wqcloud');
// const TRADE = require('wqcloud').TRADE;

const trade = TRADE({
  SecretId: 'xxxxx',
  SecretKey: 'xxxx'
});
// Within Async Func
(async() => {
  const balance = await trade.describeAccountBalance();
  console.log(balance);
})();

地域相关 CVM

API文档参考: https://www.qcloud.com/document/api/558/7758

点播 VOD

API文档参考: https://www.qcloud.com/document/product/266/7788

及其他未列出的服务

基本涵盖所有, 只要检查 API接口访问地址是否类似这样的格式 https://${service}.api.qcloud.com/v2/index.php 即可.

直播 LVB (wqcloud-video)

参考项目: https://github.com/AirDwing/wqcloud-video

CHANGELOG

v5.0.0

2018-11-28

支持 v3 接口。

v3.0.2

2017-05-11

更新了签名算法,进一步优化代码,将代码行数缩减到82行(含空行)。

v2.0.2

2017-01-06

waliyun 阿里云SDK修改适配到 QCloud

v2.0.0

2016-09-06

  • 使用元编程方式进行重构,减少重复代码和Action限制;
  • 更新文档链接。

v1.0.0

2016-05-16 解决了签名偶发错误的问题。

License

MIT

通过支付宝捐赠:

qr