@innovorder/serverless-resize-bucket-images

中文文档
2.3021.1发布于 2026/11/01MITCommonJS

When an image is uploaded to the bucket and his path contains toBeResized (uploads/<brand_id/brand_hash>/toBeResized/image1.png), the image resizer Cloud Function resizes and compress it. When the job is done, the new image is uploaded to the same pat

原始使用文档
文档目录3 节
  1. IMPORTANT
  2. Requirements
  3. Logging

How it works

When an image is uploaded to the bucket and his path contains toBeResized (uploads/<brand_id/brand_hash>/toBeResized/image1.png), the image resizer Cloud Function resizes and compress it. When the job is done, the new image is uploaded to the same path extracting the toBeResized part (uploads/<brand_id/brand_hash>/image1.png).

Local development

You need to set (or create in a .env file) a GOOGLE_APPLICATION_CREDENTIALS environment variable with the path to your Google Storage credentials.

Use yarn start to load a local hot reloaded instance of the Cloud Function. The instance listens on http://localhost:8080. You must do a POST request to simulate an event (https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/master/docs/events.md). To test inputs you must send a body with data as it follows:

{
    "data": {
        "bucket": "static-dev.innovorder.fr",
        "name": "uploads/toBeResized/test-image.png"
    }
}

Deployment

IMPORTANT

Remove eslint-config-innovorder package before deploying. Cloud function deployment tries to install devDependencies also (which is not normal) and it will not found this package.

Requirements

Install Google Cloud SDK in your system and authenticate with gcloud (https://cloud.google.com/sdk/docs/authorizing#running_gcloud_auth_login).

To deploy an specific version, just checkout this repository and run yarn deploy-<environment_name>, where environment_name can be dev, preprod or prod.

Logging

To see the deployed Cloud Function logs use yarn logs-<environment_name>

版本与发布记录

@innovorder/serverless-resize-bucket-images 共发布 8,438 个版本,首次发布于 2021/05/07;过去 12 个月发布了 1488 个版本。

版本发布日期距今
2.3021.1latest2026/11/012 天前
2.3021.02026/11/012 天前
2.3020.12026/11/012 天前
2.3020.02026/11/012 天前
2.3019.02026/10/312 天前
2.3018.12026/10/313 天前

关于 @innovorder/serverless-resize-bucket-images 的常见问题

@innovorder/serverless-resize-bucket-images 是什么?

当一个图像被上传到bucket并且它的路径包含 toBeResized (uploads/<brand_id/brand_hash>/toBeResized/image1.png),图像调整器云功能调整大小并压缩它。工作完成后,将新图像上传到相同的部分

如何安装 @innovorder/serverless-resize-bucket-images?

在项目目录运行 npm install @innovorder/serverless-resize-bucket-images,或使用 pnpm add / yarn add / bun add。

@innovorder/serverless-resize-bucket-images 支持 TypeScript 吗?

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

@innovorder/serverless-resize-bucket-images 支持 ESM 还是 CommonJS?

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

@innovorder/serverless-resize-bucket-images 需要什么版本的 Node.js?

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

@innovorder/serverless-resize-bucket-images 可以商用吗?

@innovorder/serverless-resize-bucket-images 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@innovorder/serverless-resize-bucket-images 还在维护吗?

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