google-gax

中文文档
6.16.0发布于 2026/11/04Apache-2.0TypeScriptCommonJS

Google API Extensions

原始使用文档
文档目录5 节
  1. Installation
  2. Supporting older version of Node.js
  3. Contributing
  4. Details
  5. License
Google Inc. logo

Google API Extensions for Node.js

Release Level npm version

Google API Extensions for Node.js (gax-nodejs) is a set of modules which aids the development of APIs for clients and servers based on gRPC and Google API conventions.

Application code will rarely need to use most of the classes within this library directly, but code generated automatically from the API definition files in Google APIs can use services such as page streaming and request bundling to provide a more convenient and idiomatic API surface to callers.

Installation

$ npm install google-gax

Supporting older version of Node.js

This library uses grpc-js package for communicating with API server, and it uses HTTP/2 functionality that is only available in Node.js v8.13.0 or newer. If you need to use this library with older versions of Node.js, you need to make your code depend on a legacy gRPC library (grpc) and pass the instance of gRPC to the client constructor:

const grpc = require('grpc');
const client = new APIClient({ grpc }); // APIClient is the client class you use, e.g. SpeechClient, etc.

Contributing

Contributions to this library are always welcome and highly encouraged. See the CONTRIBUTING documentation for more information on how to get started.

Details

For detailed documentation of the modules in gax-nodejs, please check out the docs.

License

Apache 2.0 - See LICENSE for more information.

版本与发布记录

google-gax 共发布 403 个版本,首次发布于 2016/06/11;过去 12 个月发布了 22 个版本。

版本发布日期距今
6.16.0latest2026/11/04今天
6.14.02026/10/295 天前
6.13.02026/10/2014 天前
6.12.12026/10/0926 天前
6.12.02026/10/0827 天前
6.11.02026/10/0628 天前

其他发布通道:bundle → 2.9.0-bundle,load-proto-json → 2.12.0-pre.1,legacy-8 → 1.15.4,rest_stream → 2.28.0-pre.1,legacy-10 → 2.30.5,next → 4.0.1。

关于 google-gax 的常见问题

google-gax 是什么?

谷歌API扩展

如何安装 google-gax?

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

google-gax 支持 TypeScript 吗?

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

google-gax 支持 ESM 还是 CommonJS?

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

google-gax 需要什么版本的 Node.js?

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

google-gax 可以商用吗?

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

google-gax 还在维护吗?

最新版本 6.16.0 发布于 2026/11/04(今天);至今共发布 403 个版本,其中过去 12 个月发布了 22 个;首次发布于 2016/06/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。