@exodus/ui-config

中文文档
3.13.4发布于 2026/09/29MITTypeScriptES Module近 30 天下载 1.1万

Helper for storing various UI-specific settings/config.

原始使用文档

@exodus/ui-config

Helper for storing various UI-specific settings/config. Use this ONLY for UI-specific settings/config. Most data is NOT UI-specific and should be managed by domain-specific features/modules/atoms in the background.

Valid examples:

  • Boolean flag that controls whether to show price maps in the UI
  • Boolean flag that flips to true after onboarding was shown
  • Counter for how many times a modal has been shown, or needs to be shown

Usage

import uiConfig from '@exodus/ui-config'

// exodus is created via `@exodus/headless`
exodus.use(
  uiConfig({
    config: [
      // Note: these are NOT atom definitions, they're only metadata about atoms: `id` and later `type` (so we can
      // internally instantiate different types of atoms)
      //
      // these are emitted to the `port` as events 'delightUser' and 'terrifyUser'
      { id: 'delightUser' },
      { id: 'terrifyUser' },
    ],
  })
)

// API usage
exodus.uiConfig.delightUser(true)
exodus.uiConfig.terrifyUser(false)

// Port events feature emit data from atoms in with following format: port.emit('delightUserAtom', value)

版本与发布记录

@exodus/ui-config 共发布 27 个版本,首次发布于 2023/08/08;过去 12 个月发布了 4 个版本。

版本发布日期距今
3.13.4latest2026/09/291 个月前
3.13.32026/01/309 个月前
3.13.22026/01/149 个月前
3.13.12025/12/2510 个月前
3.13.02024/11/262 年前
3.12.12024/09/272 年前

关于 @exodus/ui-config 的常见问题

@exodus/ui-config 是什么?

Helper for storing various UI-specific settings/config.

如何安装 @exodus/ui-config?

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

@exodus/ui-config 支持 TypeScript 吗?

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

@exodus/ui-config 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@exodus/ui-config 可以商用吗?

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

@exodus/ui-config 的下载量有多少?

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

@exodus/ui-config 还在维护吗?

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