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

j-tencentcloud-sdk-nodejs

v0.0.2

Published

腾讯云 API NODEJS SDK for signature v3

Downloads

1

Readme

简介

欢迎使用腾讯云开发者工具套件(SDK)3.0,SDK3.0是云 API3.0 平台的配套工具。目前已经支持cvm、vpc、cbs等产品,后续所有的云服务产品都会接入进来。新版SDK实现了统一化,具有各个语言版本的SDK使用方法相同,接口调用方式相同,统一的错误码和返回包格式这些优点。 为方便 NODEJS 开发者调试和接入腾讯云产品 API,这里向您介绍适用于 NODEJS 的腾讯云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯云 NODEJS SDK 并开始调用。

依赖环境

  1. NODEJS 7.10.1 版本及以上
  2. 从腾讯云控制台 开通相应产品
  3. 获取 SecretID、SecretKey 以及调用地址(endpoint),endpoint 一般形式为*.tencentcloudapi.com,如CVM 的调用地址为 cvm.tencentcloudapi.com,具体参考各产品说明。

获取安装

安装 NODEJS SDK 前,先获取安全凭证。在第一次使用云API之前,用户首先需要在腾讯云控制台上申请安全凭证,安全凭证包括 SecretID 和 SecretKey, SecretID 是用于标识 API 调用者的身份,SecretKey是用于加密签名字符串和服务器端验证签名字符串的密钥。SecretKey 必须严格保管,避免泄露。

通过 Npm 安装

通过 npm 获取安装是使用 NODEJS SDK 的推荐方法,npm 是 NODEJS 的包管理工具。关于 npm 详细可参考 npm 官网

  1. 执行以下安装命令:

    npm install tencentcloud-sdk-nodejs --save

  2. 在您的代码中引用对应模块代码,可参考示例。

通过源码包安装

  1. 前往 Github 代码托管地址 下载源码压缩包。
  2. 解压源码包到您项目合适的位置。
  3. 在您的代码中引用对应模块代码,可参考示例。

示例

const tencentcloud = require("../../../../tencentcloud-sdk-nodejs");

// 导入对应产品模块的client models。
const CvmClient = tencentcloud.cvm.v20170312.Client;
const models = tencentcloud.cvm.v20170312.Models;

const Credential = tencentcloud.common.Credential;

// 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey
let cred = new Credential("secretId", "secretKey");

// 实例化要请求产品(以cvm为例)的client对象
let client = new CvmClient(cred, "ap-shanghai");

// 实例化一个请求对象
let req = new models.DescribeZonesRequest();

// 通过client对象调用想要访问的接口,需要传入请求对象以及响应回调函数
client.DescribeZones(req, function(err, response) {
    // 请求异常返回,打印异常信息
    if (err) {
        console.log(err);
        return;
    }
    // 请求正常返回,打印response对象
    console.log(response.to_json_string());
});

更多示例

更丰富的使用demo请在examples目录中寻找。

相关配置

代理

如果是有代理的环境下,需要设置系统环境变量 https_proxy ,否则可能无法正常调用,抛出连接超时的异常。

旧版SDK

我们推荐使用新版NODEJS SDK,如果一定要用旧版SDK,请前往github仓库下载。