@auth0/component-cdn-uploader

中文文档
2.5.1发布于 2026/03/26MITCommonJS构建来源已验证近 30 天下载 2772

Tool to upload web widgets to Auth0 CDN via S3 bucket.

原始使用文档
文档目录8 节
  1. Install
  2. Configuration
  3. Files Cryptographic Digest
  4. Usage
  5. types
  6. Issue Reporting
  7. Author
  8. License

component-cdn-uploader

Tool to upload web widgets to Auth0 CDN via S3 bucket.

Install

via yarn

yarn add @auth0/component-cdn-uploader --dev

via npm

npm install @auth0/component-cdn-uploader --save-dev

Configuration

In your package.json add the following entry

"ccu": {
  "cdn": "https://cdn.auth0.com",
  "mainBundleFile": "lock.min.js",
  "bucket": "mybucket",
  "remoteBasePath": "js"
}

where

  • cdn: url where your CDN can be found so the lib checks if a version is already uploaded
  • mainBundleFile: name of the file used when checking the CDN if a specific version is already uploaded
  • bucket: name of the S3 bucket to upload to
  • remoteBasePath: path in the bucket where to store the component.

You can also have the following entries

  • name: name of the folder inside remoteBasePath that overrides the default from package's name.
  • snapshotName: name of the snapshot version that will override the default development

Files Cryptographic Digest

If you need the digest of the files you upload you can also add inside ccu in your package.json the following

"digest": {
  "hashes": ["sha384"]
}

This will generate the sha384 digest of every file to upload and store it in a different file named <filename>.<hash-method>. In the case you only need to hash only some files, e.g. JS only

"digest": {
  "hashes": ["sha384"],
  "extensions": [".js"]
}

The valid types of digests are sha256, sha384 and sha512, if none is specified the tool will generate no digest files.

Usage

$ ccu [options] [directory ...]

options

  • --type (string) type of upload flow to perform (one of 'default', 'release', 'snapshot')
  • --only-full only upload full major-minor-patch version, ignored if type is 'snapshot'
  • --dry perform a dry run
  • --snapshot-name (string) name used for snapshot. Default is 'development'
  • --silent run in silent mode
  • --trace run with verbose log
  • --version-override (string) indicate semantic version number to upload (overrides package.json version)

types

  • default: will upload, if it does not exist in cdn (checking mainBundleFile existence), using full and major-minor tags (or full only if only-full is specified) or just the snapshot tag.
  • release: will only upload, if it does not exist in cdn (checking mainBundleFile existence), using full and major-minor tags (or full only if only-full is specified) and no snaphost tag.
  • snapshot: will always upload the snapshot tag.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

版本与发布记录

@auth0/component-cdn-uploader 共发布 15 个版本,首次发布于 2017/06/09;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.5.1latest2026/03/267 个月前
3.0.22026/03/267 个月前
3.0.12026/03/267 个月前
3.0.02026/03/257 个月前
2.5.02026/03/257 个月前
2.4.22025/11/2211 个月前

关于 @auth0/component-cdn-uploader 的常见问题

@auth0/component-cdn-uploader 是什么?

Tool to upload web widgets to Auth0 CDN via S3 bucket.

如何安装 @auth0/component-cdn-uploader?

在项目目录运行 npm install @auth0/component-cdn-uploader,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 ccu,可以用 npx ccu 直接运行。

@auth0/component-cdn-uploader 支持 TypeScript 吗?

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

@auth0/component-cdn-uploader 支持 ESM 还是 CommonJS?

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

@auth0/component-cdn-uploader 需要什么版本的 Node.js?

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

@auth0/component-cdn-uploader 可以商用吗?

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

@auth0/component-cdn-uploader 的下载量有多少?

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

@auth0/component-cdn-uploader 还在维护吗?

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