@google-cloud/common-grpc

中文文档
1.0.10发布于 2020/01/16Apache-2.0TypeScriptCommonJS近 30 天下载 3.7万

Common components for Cloud APIs Node.js Client Libraries that require gRPC

原始使用文档
文档目录7 节
  1. Quickstart
  2. Installing the client library
  3. Using the client library
  4. Samples
  5. Versioning
  6. Contributing
  7. License

Google Cloud Platform logo

Google Cloud Common gRPC: Node.js Client

release level npm version codecov

Common components for Cloud APIs Node.js Client Libraries that require gRPC

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Installing the client library

npm install @google-cloud/common-grpc

Using the client library

const common = require('@google-cloud/common-grpc');
console.log(common);

Samples

Samples are in the samples/ directory. The samples' README.md has instructions for running the samples.

SampleSource CodeTry it
Quickstartsource codeOpen in Cloud Shell

The Google Cloud Common gRPC Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be General Availability (GA). This means it is stable; the code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against GA libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

版本与发布记录

@google-cloud/common-grpc 共发布 46 个版本,首次发布于 2017/01/31;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.10latest2020/01/166 年前
1.0.92019/12/066 年前
1.0.82019/10/197 年前
1.0.72019/10/147 年前
1.0.62019/10/107 年前
1.0.52019/08/167 年前

关于 @google-cloud/common-grpc 的常见问题

@google-cloud/common-grpc 是什么?

Common components for Cloud APIs Node.js Client Libraries that require gRPC

如何安装 @google-cloud/common-grpc?

在项目目录运行 npm install @google-cloud/common-grpc,或使用 pnpm add / yarn add / bun add。

@google-cloud/common-grpc 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@google-cloud/common-grpc 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@google-cloud/common-grpc 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=8.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@google-cloud/common-grpc 可以商用吗?

@google-cloud/common-grpc 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@google-cloud/common-grpc 的下载量有多少?

根据 npm 官方下载统计,@google-cloud/common-grpc 在 2026/10/17 – 2026/11/15 这 30 天内被下载 36,798 次,日均约 1,227 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@google-cloud/common-grpc 还在维护吗?

最新版本 1.0.10 发布于 2020/01/16(6 年前);至今共发布 46 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/01/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。