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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cn-cloud-billing

v1.0.0

Published

One typed API for Alibaba Cloud, Tencent Cloud and Volcano Engine monthly bills — normalized summary + per-resource detail. Bring your own keys.

Readme

cn-cloud-billing

npm version CI license

One typed API for Alibaba Cloud, Tencent Cloud and Volcano Engine monthly bills.

Each Chinese cloud ships its own billing API with different auth, shapes, pagination and quirks. cn-cloud-billing puts all three behind a single call and hands you normalized rows — monthly totals by product, or per-resource detail with region and resource id. Bring your own access keys; it imposes no categorization or cost attribution — just the numbers, normalized.

npm i cn-cloud-billing

Quick start

import { CnBilling } from "cn-cloud-billing";

const billing = new CnBilling({
  aliyun:  { accessKeyId: process.env.ALI_AK!,   accessKeySecret: process.env.ALI_SK! },
  tencent: { secretId:    process.env.TC_ID!,    secretKey:       process.env.TC_KEY! },
  volcano: { accessKeyId: process.env.VOLC_AK!,  secretAccessKey: process.env.VOLC_SK! },
});

// Monthly totals by product, across all three clouds:
const summary = await billing.getMonthlySummary("2026-05");
// → [{ provider: "aliyun", month: "2026-05", product: "ECS", amount: 1234.5, currency: "CNY" }, ...]

// Per-resource detail (region + resourceId where the API exposes them):
const detail = await billing.getMonthlyDetail("2026-05");
// → [{ provider: "volcano", month: "2026-05", product: "GPU_Server",
//      region: "cn-beijing", resourceId: "i-abc…", amount: 88.0, currency: "CNY" }, ...]

Query one cloud in isolation:

const rows = await billing.provider("tencent").getMonthlyDetail("2026-05");

Normalized shape

Every row is a BillRow:

interface BillRow {
  provider: "aliyun" | "tencent" | "volcano";
  month: string;        // "YYYY-MM"
  product: string;      // provider's product / business name
  region?: string;      // detail only
  resourceId?: string;  // detail only
  amount: number;       // payable / real cost in `currency`
  currency: string;     // e.g. "CNY"
  raw?: unknown;        // original provider line, with { includeRaw: true }
}

amount maps to each provider's payable cost — Aliyun PretaxAmount, Tencent ΣComponentSet.RealCost, Volcano PayableAmount.

What it handles for you

  • Auth & signing — official SDKs for Aliyun/Tencent; Volcano is driven through @volcengine/openapi's signer (no maintained Node billing SDK exists).
  • Pagination — Aliyun NextToken, Tencent Offset, Volcano Offset (including the case where Volcano returns Total = -1 and you must stop on a short page).
  • Quirks — Volcano detail needs GroupPeriod = 1; Tencent detail cost is the sum of a row's ComponentSet.

Credentials

| Provider | Fields | Needs | | --- | --- | --- | | aliyun | accessKeyId, accessKeySecret | BssOpenApi read access | | tencent | secretId, secretKey | DescribeBillSummaryByProduct / DescribeBillDetail | | volcano | accessKeyId, secretAccessKey | ListBillOverviewByProd / ListBillDetail |

Configure only the clouds you use — pass one, two, or all three.

Notes

  • Amounts are in each account's settlement currency (typically CNY); this library does no FX conversion (pair it with monthly-fx if you need USD).
  • This is an independent client and is not affiliated with Alibaba, Tencent or Volcano Engine.

License

MIT © oratis