@fest-lib/core

中文文档
0.1.40发布于 2026/11/08MITES Module零依赖近 30 天下载 2780

fest-lib core: getValue, type guards, deferred promises, paths, time, grid math

原始使用文档
文档目录3 节
  1. Install
  2. What you get
  3. Workspace

@fest-lib/core
Level 0.5 — no fest peers. Everything else in the stack unwraps values through this package.

npm MIT stars

getValue on refs, type / empty guards, deferred promises, channels, mapped collections, user-scope paths, time / phone helpers, launcher grid math, WeakRef wrappers, and DOM constructor polyfills so the same code runs in window, worker, and Node.

fest/core          ← you are here
 └── dom · object · veela · uniform · lure · icon · image · fl-ui

Install

npm install @fest-lib/core

ESM only. Node 20+. No peer dependencies.

import { getValue, isObject, createDeferred, debounce } from "@fest-lib/core";

const raw = getValue(maybeRef);          // ref.value or the value itself
const { promise, resolve } = createDeferred<string>();
const onResize = debounce(() => measure(), 48);

What you get

AreaTypical exportsSource
Refs & typesgetValue, isObjectsrc/utils/Primitive.ts
PromisescreateDeferred, queues, timeoutssrc/utils/PromiseUtils.ts
Debouncedebouncesrc/utils/Misc.ts
Collectionsmapped helperssrc/utils/Mapped.ts
Pathsuser-scope normalizesrc/utils/UserPath.ts
Launcher gridcell / layout mathsrc/utils/GridItemUtils.ts
Time / phoneformat helperssrc/utils/Time.ts, Phone.ts
Host polyfillsEventTarget / DOM ctors in workerssrc/runtime/dom-globals-polyfill.ts

Importing the package installs the polyfills once. That is intentional.

Workspace

cd modules/projects/core.ts
npm run dev          # Vite playground
npm run build        # dist + typedoc
npm run publish      # patch +1, then npm publish

Generated API: npm run docs:md → ./docs-md. License: MIT.

版本与发布记录

@fest-lib/core 共发布 37 个版本,首次发布于 2026/08/07;过去 12 个月发布了 37 个版本。

版本发布日期距今
0.1.40latest2026/11/086 天前
0.1.392026/11/086 天前
0.1.372026/11/0113 天前
0.1.362026/10/3015 天前
0.1.342026/10/2916 天前
0.1.332026/10/2916 天前

其他发布通道:beta → 0.1.1。

关于 @fest-lib/core 的常见问题

@fest-lib/core 是什么?

fest-lib core: getValue, type guards, deferred promises, paths, time, grid math

如何安装 @fest-lib/core?

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

@fest-lib/core 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fest-lib__core 是否存在。

@fest-lib/core 支持 ESM 还是 CommonJS?

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

@fest-lib/core 需要什么版本的 Node.js?

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

@fest-lib/core 可以商用吗?

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

@fest-lib/core 的下载量有多少?

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

@fest-lib/core 还在维护吗?

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