@aws-sdk/core

中文文档
3.980.0发布于 2026/11/05Apache-2.0TypeScriptESM + CJS近 30 天下载 4.3亿

Core functions & classes shared by multiple AWS SDK clients.

原始使用文档
文档目录3 节
  1. @aws-sdk/core submodules
  2. Guide for submodules
  3. When should I create an @aws-sdk/core/submodule vs. @aws-sd…

@aws-sdk/core

This package provides common or core functionality to the AWS SDK for JavaScript (v3).

You do not need to explicitly install this package, since it will be transitively installed by AWS SDK clients.

@aws-sdk/core submodules

Core submodules are organized for distribution via the package.json exports field.

exports is supported by default by the latest Node.js, webpack, and esbuild. For react-native, it can be enabled via instructions found at reactnative.dev/blog.

Think of @aws-sdk/core as a mono-package within the monorepo. It preserves the benefits of modularization, for example to optimize Node.js initialization speed, while making it easier to have a consistent version of core dependencies, reducing package sprawl when installing an SDK client.

Guide for submodules

  • Each index.ts file corresponding to the pattern ./src/submodules/<MODULE_NAME>/index.ts will be published as a separate dist-cjs bundled submodule index using the Inliner.js build script.
  • create a folder as ./src/submodules/<SUBMODULE> including an index.ts file and a README.md file.
    • The linter will throw an error on missing submodule metadata in package.json and the various tsconfig.json files, but it will automatically fix them if possible.
  • a submodule is equivalent to a standalone @aws-sdk/<pkg> package in that importing it in Node.js will resolve a separate bundle.
  • submodules may not relatively import files from other submodules. Instead, directly use the @scope/pkg/submodule name as the import.
    • The linter will check for this and throw an error.
  • To the extent possible, correctly declaring submodule metadata is validated by the linter in @aws-sdk/core. The linter runs during yarn build and also as yarn lint.

When should I create an @aws-sdk/core/submodule vs. @aws-sdk/new-package?

Keep in mind that the core package is installed by all AWS SDK clients.

If the component functionality is upstream of multiple clients, it is a good candidate for a core submodule. For example, XML serialization.

If the component's functionality is downstream of a client, for example S3 pre-signing, it should be a standalone package with potentially a peer or runtime dependency on an AWS SDK client.

版本与发布记录

@aws-sdk/core 共发布 241 个版本,首次发布于 2023/10/17;过去 12 个月发布了 109 个版本。

版本发布日期距今
3.980.0latest2026/11/051 天前
3.979.12026/10/316 天前
3.979.02026/10/307 天前
3.978.72026/10/298 天前
3.978.62026/10/2710 天前
3.978.52026/10/2215 天前

关于 @aws-sdk/core 的常见问题

@aws-sdk/core 是什么?

Core functions & classes shared by multiple AWS SDK clients.

如何安装 @aws-sdk/core?

在项目目录运行 npm install @aws-sdk/core,或使用 pnpm add / yarn add / bun add。

@aws-sdk/core 支持 TypeScript 吗?

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

@aws-sdk/core 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aws-sdk/core 需要什么版本的 Node.js?

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

@aws-sdk/core 可以商用吗?

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

@aws-sdk/core 的下载量有多少?

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

@aws-sdk/core 还在维护吗?

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