@digitalwalletcorp/utils

中文文档
0.17.0发布于 2026/11/10MITTypeScriptESM + CJS近 30 天下载 3329

A javascript utility.

原始使用文档

utils

NPM Version License Build Status Test Coverage

A set of javascript utilities.

UtilityDescription
CryptoUtilCryptographic and token generation helpers.
ZonedDateTimeImmutable date and time with its own time zone, for multi-step date calculations.
DateUtilDate and time parsing, formatting and comparison with explicit time zones.
DecimalImmutable decimal arithmetic for multi-step calculations.
FileUtilConversion between base64, DataURL and binary, and file type detection.
HtmlUtilHTML content transformation and sanitization.
JsonUtilJSON parsing and serialization that keeps large integers intact.
NumberUtilPrecision-safe numeric calculations and formatting.
ObjectUtilDeep cloning, merging and inspection of objects.
StringUtilGeneral string manipulation and processing.

✅ Compatibility

  • ✅ Node.js: Fully supported on all modern Node.js versions.
  • ✅ Browsers: Fully supported on all modern browsers that support ES2020 (BigInt).
  • ✅ Module formats: CommonJS and ESM.

📦 Installation

npm install @digitalwalletcorp/utils
# or
yarn add @digitalwalletcorp/utils

📖 Usage

import { NumberUtil } from '@digitalwalletcorp/utils';

NumberUtil.formatComma(1234567.891, 2); // '1,234,567.89'

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

版本与发布记录

@digitalwalletcorp/utils 共发布 20 个版本,首次发布于 2026/09/28;过去 12 个月发布了 20 个版本。

版本发布日期距今
0.17.0latest2026/11/101 天前
0.16.02026/11/102 天前
0.15.02026/11/093 天前
0.14.02026/11/093 天前
0.13.12026/11/093 天前
0.13.02026/11/093 天前

关于 @digitalwalletcorp/utils 的常见问题

@digitalwalletcorp/utils 是什么?

A javascript utility.

如何安装 @digitalwalletcorp/utils?

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

@digitalwalletcorp/utils 支持 TypeScript 吗?

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

@digitalwalletcorp/utils 支持 ESM 还是 CommonJS?

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

@digitalwalletcorp/utils 需要什么版本的 Node.js?

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

@digitalwalletcorp/utils 可以商用吗?

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

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

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

@digitalwalletcorp/utils 还在维护吗?

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