@4players/odin-common

中文文档
12.1.0发布于 2026/11/01ISCTypeScriptESM + CJS近 30 天下载 4035

Commonly used type definitions and utility functions across ODIN web projects

原始使用文档
文档目录9 节
  1. Entrypoints
  2. @4players/odin-common
  3. @4players/odin-common/api
  4. @4players/odin-common/zod
  5. Troubleshooting
  6. Discord
  7. Twitter
  8. Email
  9. Dependency maintenance

@4players/odin-common

npm npm npm

A collection of commonly used type definitions and schemas across ODIN web projects.

Entrypoints

The package is split into three entrypoints:

@4players/odin-common

Lightweight utilities with no heavy dependencies. Includes logging, a Result type, video codec helpers, async primitives (sleep, task queues, promise racing), base64/byte array encoding, UUID generation, environment detection, type guards, URL helpers and the backend plugin API types.

import { Logger, LogFilter } from '@4players/odin-common';

@4players/odin-common/api

Zod-based schemas for the ODIN Voice protocol (rooms, peers, media, tokens, channels) and RPC command/notification definitions. Importing from this entrypoint will pull in Zod.

import { TokenClaims, TokenClaimsSchema } from '@4players/odin-common/api';

@4players/odin-common/zod

Re-exports the Zod library for consumers that need to create their own schemas without adding a separate Zod dependency.

import { z } from '@4players/odin-common/zod';

Troubleshooting

Contact us through the listed methods below to receive answers to your questions and learn more about ODIN.

Discord

Join our official Discord server to chat with us directly and become a part of the 4Players ODIN community.

Join us on Discord

Twitter

Have a quick question? Tweet us at @ODIN4Players and we’ll help you resolve any issues.

Email

Don’t use Discord or Twitter? Send us an email and we’ll get back to you as soon as possible.

Dependency maintenance

Use npm 12 or newer when updating dependencies so both the ten-day release age and the @4players/* exception are enforced. Check npm --version and npm config get min-release-age before installing. Keep registry credentials in your user configuration or CI secrets, outside tracked policy files.

Select stable releases at least ten days old, including transitive dependencies. First-party @4players/* packages are exempt; their third-party dependencies are not. Keep TypeScript on 6.x and align shared versions across the ODIN repositories where peer requirements permit. Preserve and review lockfiles; existing locked versions are not evidence of release-age eligibility.

Install with npm install --min-release-age=10 --min-release-age-exclude='@4players/*'. Use npm ci for reproducible installs from the reviewed lockfile.

Use Deno 2.9.7 or newer; minimumDependencyAge in deno.json applies the ten-day policy to npm and JSR dependencies across the workspace. Preserve deno.lock; use --frozen-lockfile in reproducible builds. The npm artifact build also enforces the npm policy explicitly.

版本与发布记录

@4players/odin-common 共发布 126 个版本,首次发布于 2023/11/29;过去 12 个月发布了 27 个版本。

版本发布日期距今
12.1.0latest2026/11/016 天前
12.0.02026/10/061 个月前
11.4.22026/09/251 个月前
11.4.12026/08/122 个月前
11.4.02026/07/273 个月前
11.3.02026/07/153 个月前

关于 @4players/odin-common 的常见问题

@4players/odin-common 是什么?

Commonly used type definitions and utility functions across ODIN web projects

如何安装 @4players/odin-common?

在项目目录运行 npm install @4players/odin-common,或使用 pnpm add / yarn add / bun add。

@4players/odin-common 支持 TypeScript 吗?

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

@4players/odin-common 支持 ESM 还是 CommonJS?

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

@4players/odin-common 可以商用吗?

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

@4players/odin-common 的下载量有多少?

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

@4players/odin-common 还在维护吗?

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