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

@peerless-hero/aliyun-sdk

v1.0.1

Published

Aliyun sdk for Node.js

Downloads

177

Readme

@peerless-hero/aliyun-sdk

本工具是对基于阿里云OpenAPI封装的SDK工具。由于官方提供的SDK难于使用,且文档过少,因此自己封装了一套工具。

目录

安装

# npm
npm install --save @peerless-hero/aliyun-sdk

# yarn
yarn add -D @peerless-hero/aliyun-sdk

# pnpm
pnpm add -D @peerless-hero/aliyun-sdk

使用

// 以Cas功能模块为例
// 默认导出均为当前API文档描述的默认版本
import { type Cas, CasClient } from '@peerless-hero/aliyun-sdk'
// 初始化实例时,你可以不直接传入accessKeyId和accessKeySecret的参数
// 而是提供环境变量 ALIYUN_ACCESS_KEY_ID 和 ALIYUN_ACCESS_KEY_SECRET
// SDK会自动读取环境变量并使用
const cas = new CasClient({
  // 阿里云AccessKey
  accessKeyId: 'xxxxxxxxxxxxxxxx',
  // 阿里云AccessKeySecret
  accessKeySecret: 'xxxxxxxxxxxxxxxx',
})
// 使用其中的类型
let result: Cas.DescribeCACertificateListData | null = null
// 调用方法
// 所有方法名称均取自官方文档
result = await cas.DescribeCACertificateList({})
// 默认导出均为当前API的默认版本,如需使用特定版本,请以如下方式导入
// 例如使用2020-06-30版本的Cas模块
import { type Cas, CasClient } from '@peerless-hero/aliyun-sdk/versions/2020-06-30'
// 所有模块均默认使用了文档提供的第一个Endpoint,如需切换,请使用如下方式设置
cas.setEndpoint('cn-hangzhou') // 设置请求域名

注意事项

  • 本工具仅支持版本不小于17.15.0的Node.js环境。
  • 本工具不提供oss相关接口,因为这部分接口签名方式与其他接口存在较大差异。因为阿里云oss是兼容s3协议的,所以更推荐s3-sdk进行相关操作,
  • 本工具代码基于阿里云公开的产品文档接口自动生成,可能因文档更新而产生遗漏。届时如有更新需求,请在github上提issue

License

MIT License © 2023-PRESENT Peerless Hero