@buxlabs/utils

中文文档
2.3.4发布于 2018/05/14MITESM + CJS零依赖近 30 天下载 1717

buxlabs utils

原始使用文档
文档目录12 节
  1. Installation
  2. Usage
  3. cjs
  4. es
  5. Methods
  6. array
  7. object
  8. string
  9. date
  10. json
  11. math
  12. Development

Utils

Codeship

A set of utility methods reused exported as a UMD module. Methods can also be imported directly.

Installation

npm install @buxlabs/utils

Usage

cjs

const { flatten } = require('@buxlabs/utils/object');
flatten({ hello: { world: '1234' } }); // { 'hello.world': '1234' }

es

import { flatten } from '@buxlabs/utils/object'
flatten({ hello: { world: '1234' } }); // { 'hello.world': '1234' }

Methods

array

flatten

object

isObject

isNull

isArray

isRegExp

isFunction

isArguments

isString

isNumber

isDate

isUndefined

extend

flatten

unflatten

rename

dig

pat

string

pad

whitespaceless

dasherize

constantize

trim

uppercase

lowercase

underscore

reverse

capitalize

unescape

lowerfirst

humanize

titleize

classify

pluralize

singularize

swapcase

camelize

truncate

date

toISOString

json

prettify

math

abs

acos

acosh

asin

asinh

atan

atan2

atanh

cbrt

ceil

cos

cosh

exp

floor

log

max

min

pow

random

round

sin

sinh

sqrt

tan

tanh

trunc

Development

To see available commands run:

npm run

Lint:

npm run lint

Test:

npm test

Coverage:

npm run coverage

Build:

npm run build

版本与发布记录

@buxlabs/utils 共发布 16 个版本,首次发布于 2016/11/27;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.3.4latest2018/05/148 年前
2.3.32018/05/128 年前
2.3.22018/05/128 年前
2.3.12018/05/128 年前
2.3.02018/05/128 年前
2.2.42018/05/088 年前

关于 @buxlabs/utils 的常见问题

@buxlabs/utils 是什么?

buxlabs utils

如何安装 @buxlabs/utils?

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

@buxlabs/utils 支持 TypeScript 吗?

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

@buxlabs/utils 支持 ESM 还是 CommonJS?

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

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

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

@buxlabs/utils 可以商用吗?

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

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

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

@buxlabs/utils 还在维护吗?

最新版本 2.3.4 发布于 2018/05/14(8 年前);至今共发布 16 个版本,其中过去 12 个月发布了 0 个;首次发布于 2016/11/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。