@contentstack/core

中文文档
1.5.4发布于 2026/11/02MITTypeScriptESM + CJS构建来源已验证近 30 天下载 15万

Contentstack

原始使用文档
文档目录16 节
  1. About Contentstack
  2. Description
  3. Features
  4. Important Note
  5. For SDK Developers
  6. Development
  7. Prerequisites
  8. Setup
  9. Build
  10. Testing
  11. Packaging
  12. Clean
  13. License
  14. Repository
  15. Related Projects
  16. Support

@contentstack/core

Contentstack

TypeScript Core SDK for Contentstack - A foundational library providing core modules and utilities for Contentstack TypeScript SDKs.

About Contentstack

Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. Read More.

Description

This package contains core modules and utilities used by the Contentstack TypeScript Delivery SDK. It provides essential functionality including HTTP client configuration, error handling, request management, parameter serialization, and retry policies.

Features

  • HTTP Client: Configurable Axios-based HTTP client with support for custom adapters
  • Error Handling: Comprehensive error classes for API and Contentstack-specific errors
  • Request Management: Request handling with interceptors and custom error callbacks
  • Parameter Serialization: Custom parameter serialization for API requests
  • Retry Policies: Built-in retry logic for handling rate limits and transient errors
  • TypeScript Support: Full TypeScript definitions included
  • Multiple Build Formats: Supports CommonJS, ESM, UMD, and TypeScript declarations

Important Note

This package is an internal dependency used by Contentstack TypeScript SDKs. End users should not install this package directly. Instead, install the appropriate Contentstack SDK (e.g., Contentstack TypeScript Delivery SDK), which will automatically include this package as a dependency.

For SDK Developers

If you are developing or maintaining a Contentstack SDK and need to use this core package directly, you can install it as a dependency:

npm install @contentstack/core

Then import the modules:

import {
  httpClient,
  // ... other exports
} from '@contentstack/core';

Development

Prerequisites

  • Node.js version 4.4.7 or later

Setup

Clone the repository and install dependencies:

git clone https://github.com/contentstack/contentstack-js-core.git
cd contentstack-js-core
npm install

Build

Build all output formats (CommonJS, ESM, UMD, and TypeScript declarations):

npm run build

Build specific formats:

npm run build        # Build all
npm run build:cjs    # CommonJS
npm run build:esm    # ES Modules
npm run build:umd    # UMD
npm run build:types  # TypeScript declarations

Testing

Run unit tests:

npm run test

Run linting:

npm run lint

Packaging

Create a package tarball:

npm run package

Clean

Clean build artifacts:

npm run clean

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

Repository

Support

For issues and feature requests, please visit the GitHub Issues page.


Copyright (c) 2016-2025 Contentstack. All rights reserved.

版本与发布记录

@contentstack/core 共发布 35 个版本,首次发布于 2023/12/21;过去 12 个月发布了 19 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.4latest2026/11/028 天前
1.5.32026/10/051 个月前
1.5.22026/08/122 个月前
1.5.12026/08/053 个月前
1.5.02026/08/033 个月前
1.4.12026/06/294 个月前

关于 @contentstack/core 的常见问题

如何安装 @contentstack/core?

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

@contentstack/core 支持 TypeScript 吗?

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

@contentstack/core 支持 ESM 还是 CommonJS?

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

@contentstack/core 可以商用吗?

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

@contentstack/core 的下载量有多少?

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

@contentstack/core 还在维护吗?

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