Skip to main content

一款零依赖、实用的Javascript/Typescript工具库

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
94%
Published
17 hours ago (0.0.11)

@renzp/utils logo

Bundle Size Downloads Version License docs Change Log

@renzp/utils

一款零依赖、实用的Javascript/Typescript工具库

coverage

由于使用的bun test无法生成coverageHTML文件,所以在此列一下coverage

File % Funcs % Lines
All files 100.00 97.90
src/_base.ts 100.00 100.00
src/array.ts 100.00 96.43
src/index.ts 100.00 100.00
src/is.ts 100.00 100.00
src/number.ts 100.00 93.75
src/object.ts 100.00 90.91
src/validator.ts 100.00 100.00
src/window.ts 100.00 100.00
test/happydom.ts 100.00 100.00

安装

npm install @renzp/utils

使用

import { isNumber } from '@renzp/utils'

const v: unknown = Math.PI
if (isNumber(v)) {
  console.log(v.toFixed(2)) // 3.14
}

更多使用方法可以查看文档

Add Package

deno add @renzp/utils

Import symbol

import * as mod from "@renzp/utils";

Add Package

npx jsr add @renzp/utils

Import symbol

import * as mod from "@renzp/utils";

Add Package

yarn dlx jsr add @renzp/utils

Import symbol

import * as mod from "@renzp/utils";

Add Package

pnpm dlx jsr add @renzp/utils

Import symbol

import * as mod from "@renzp/utils";

Add Package

bunx jsr add @renzp/utils

Import symbol

import * as mod from "@renzp/utils";