@google-cloud/optimization

中文文档
3.5.0发布于 2024/05/22Apache-2.0CommonJS近 30 天下载 6089

optimization client for Node.js

此软件包已被标记为弃用

Cloud Optimization has been deprecated. Please use Google Maps Routing platform instead

原始使用文档
文档目录8 节
  1. Quickstart
  2. Before you begin
  3. Installing the client library
  4. Samples
  5. Supported Node.js Versions
  6. Versioning
  7. Contributing
  8. License

Google Cloud Platform logo

Cloud Optimization AI: Node.js Client

release level npm version

optimization client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

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

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Cloud Optimization AI API.
  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-cloud/optimization

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

SampleSource CodeTry it
Fleet_routing.batch_optimize_tourssource codeOpen in Cloud Shell
Fleet_routing.optimize_tourssource codeOpen in Cloud Shell
Quickstartsource codeOpen in Cloud Shell

The Cloud Optimization AI Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-cloud/optimization@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be 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 stable libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

版本与发布记录

@google-cloud/optimization 共发布 13 个版本,首次发布于 2022/04/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.5.0latest2024/05/222 年前
3.4.02024/04/162 年前
3.3.02024/02/142 年前
3.2.02023/10/193 年前
3.1.02023/09/083 年前
3.0.12023/09/073 年前

其他发布通道:legacy-10 → 1.0.0,legacy-12 → 2.2.2。

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

@google-cloud/optimization 是什么?

optimization client for Node.js注意:该包已被作者标记为弃用——Cloud Optimization has been deprecated. Please use Google Maps Routing platform instead

如何安装 @google-cloud/optimization?

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

@google-cloud/optimization 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/google-cloud__optimization 是否存在。

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

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

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

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

@google-cloud/optimization 可以商用吗?

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

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

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

@google-cloud/optimization 还在维护吗?

最新版本 3.5.0 发布于 2024/05/22(2 年前);至今共发布 13 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/04/22。作者已将其标记为弃用,新项目建议寻找替代方案。