@fluixi/utils

中文文档
1.0.0-alpha.108发布于 2026/11/07MITTypeScriptESM + CJS零依赖近 30 天下载 6285

Zero-dependency, strongly-typed utilities for everyday TypeScript.

原始使用文档
文档目录6 节
  1. ✨ Overview
  2. 🧩 Modules
  3. 📦 Installation
  4. 🚀 Usage
  5. 📋 Requirements
  6. 📄 License

Fluixi

@fluixi/utils

Zero-dependency, strongly-typed utilities for everyday TypeScript.

License: MIT TypeScript npm Dependencies


✨ Overview

@fluixi/utils is the foundational layer of Fluixi Core: a collection of small, tree-shakeable, fully-typed helpers with no runtime dependencies. Every module is exported under its own subpath so you only ship what you import.

🧩 Modules

ImportWhat it provides
@fluixi/utils/primitiveString, number, boolean, and date helpers.
@fluixi/utils/objectDeep get/set, clone, diff, merge, immutable path updates.
@fluixi/utils/arrayArray transforms, grouping, and set operations.
@fluixi/utils/mathsVectors, interpolation, clamping, constants, and guards.
@fluixi/utils/colorColor parsing and conversion.
@fluixi/utils/domLightweight DOM helpers.
@fluixi/utils/functionsComposition, debounce/throttle, memoization.
@fluixi/utils/cookieparseCookies, serializeCookie (HttpOnly, Secure, SameSite=Lax by default), deleteCookie, isValidCookieName.
@fluixi/utils/compareDeep equality and comparison utilities.

📦 Installation

pnpm add @fluixi/utils

🚀 Usage

import { set, get } from '@fluixi/utils/object';

const state = { users: [{ name: 'Alice' }] };

// Immutable update — returns a new object, leaves `state` untouched
const next = set(state, 'users', 0, 'name', 'Alice Updated');

get(next, 'users[0].name'); // → 'Alice Updated'
get(state, 'users[0].name'); // → 'Alice'  (original is unchanged)
import { lerp, clamp } from '@fluixi/utils/maths/fn';

lerp(0, 100, 0.25); // → 25
clamp(150, 0, 100); // → 100

📋 Requirements

  • TypeScript ≥ 5.8 (ships its own .d.ts declarations)
  • Node.js ≥ 20 / any modern bundler (ESM + CJS builds included)

📄 License

MIT © Fluixi

版本与发布记录

@fluixi/utils 共发布 56 个版本,首次发布于 2026/07/10;过去 12 个月发布了 56 个版本。

版本发布日期距今
1.0.0-alpha.108latest2026/11/078 天前
1.0.0-alpha.1072026/11/0511 天前
1.0.0-alpha.1062026/11/0213 天前
1.0.0-alpha.1052026/11/0115 天前
1.0.0-alpha.1042026/11/0115 天前
1.0.0-alpha.1032026/10/2620 天前

关于 @fluixi/utils 的常见问题

@fluixi/utils 是什么?

Zero-dependency, strongly-typed utilities for everyday TypeScript.

如何安装 @fluixi/utils?

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

@fluixi/utils 支持 TypeScript 吗?

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

@fluixi/utils 支持 ESM 还是 CommonJS?

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

@fluixi/utils 可以商用吗?

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

@fluixi/utils 的下载量有多少?

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

@fluixi/utils 还在维护吗?

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