@erpc-cloud/config

中文文档
0.5.0发布于 2026/10/28Apache-2.0TypeScriptESM + CJS零依赖近 30 天下载 4403

Library of types for IDE autocompletion of erpc config in Typescript

原始使用文档
文档目录4 节
  1. Usage
  2. Installing NPM dependencies
  3. Building a custom image
  4. Mounting from host machine

eRPC Typescript Config

This package contains the typescript definitions for the eRPC config.

Usage

To use this package, install it via npm:

npm install @erpc-cloud/config

And create a erpc.ts file:

import { createConfig } from "@erpc-cloud/config";

export default createConfig({
    server: {
        httpHostV4: "0.0.0.0",
        httpPort: 4000,
    },
    projects: [
        {
            id: "main",
            networks: [
                {
                    architecture: 'evm',
                    evm: {
                        chainId: 123
                    },
                }
            ],
            upstreams: [
                {
                    endpoint: "http://localhost:9081",
                    evm: {
                        chainId: 123
                    }
                },
                {
                    endpoint: "http://localhost:9082",
                    evm: {
                        chainId: 123
                    }
                }
            ]
        }
    ]
})

And then run eRPC with the config:

docker run -v $(pwd)/erpc.ts:/erpc.ts -p 4000:4000 -p 4001:4001 ghcr.io/erpc/erpc:latest

Installing NPM dependencies

If you have installed other dependencies besides @erpc-cloud/config, you must make sure the package.json and node_modules are also available in the container.

You can either build a new custom image with erpc as base, or mount them from your host machine.

Building a custom image

Create a Dockerfile.custom file:

FROM debian:12

COPY package.json pnpm-lock.yaml /
# COPY package.json package-lock.json /
# COPY package.json yarn.lock /

RUN pnpm install
# RUN npm install
# RUN yarn install

FROM ghcr.io/erpc/erpc:latest

COPY --from=0 /node_modules /node_modules

Then build the image:

docker build -t erpc-custom -f Dockerfile.custom .

Mounting from host machine

In this case, you can use the -v flag to mount the package.json and node_modules from your host machine.

docker run \
    -v $(pwd)/package.json:/package.json \
    -v $(pwd)/node_modules:/node_modules \
    -p 4000:4000 -p 4001:4001 ghcr.io/erpc/erpc:latest

版本与发布记录

@erpc-cloud/config 共发布 43 个版本,首次发布于 2024/11/13;过去 12 个月发布了 9 个版本。

版本发布日期距今
0.5.0latest2026/10/2817 天前
0.4.02026/10/121 个月前
0.3.02026/09/211 个月前
0.2.02026/08/312 个月前
0.1.22026/08/053 个月前
0.1.12026/06/174 个月前

关于 @erpc-cloud/config 的常见问题

@erpc-cloud/config 是什么?

Library of types for IDE autocompletion of erpc config in Typescript

如何安装 @erpc-cloud/config?

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

@erpc-cloud/config 支持 TypeScript 吗?

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

@erpc-cloud/config 支持 ESM 还是 CommonJS?

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

@erpc-cloud/config 可以商用吗?

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

@erpc-cloud/config 的下载量有多少?

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

@erpc-cloud/config 还在维护吗?

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