npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

iplugins

v1.1.8

Published

* uuidv7

Readme

方法

随机值

  • uuidv7

1.1.8 增加

生成随机的uuid值

数字处理

  • moneyToChinese

数字金额转中文

moneyToChinese(money, uppercase?);

  • money - 金额, 整数最大支持15位, 小数支持两位, 但整数加小数最大16位数, 暂不支持负数
  • uppercase - 是否为大写中文, 默认小写中文
import { moneyToChinese } from 'iplugins';

moneyToChinese(0.1); // 一角
moneyToChinese(0.01); // 一分
moneyToChinese(0); // 零元整
moneyToChinese(101.22); // 一百零一元二角二分
moneyToChinese(101.22, true); // 壹佰零壹元贰角贰分
moneyToChinese(500_000); // 五十万元整
moneyToChinese(110_000_001); // 一亿一千万零一元整
moneyToChinese(999_999_999_999_999.9); // 九百九十九兆九千九百九十九亿九千九百九十九万九千九百九十九元九角
  • numberSplit

数字分割, 会分割所有数字, 包裹多位小数的数

1.1.7: 当传入数字相关内容时直接返回'0'

import { numberSplit } from 'iplugins';

numberSplit(1000.12); // 1,000.12
numberSplit(1000.123456); // 1,000.123,456
  • moneySplit

金额分割, 只会分割小数点前的数字

import { moneySplit } from 'iplugins';

moneySplit(1000.12); // 1,000.12

字符串处理

  • parseSearchParams

search参数转对象

import { parseSearchParams } from 'iplugins';

parseSearchParams(window.location.search): Object;

base64处理

  • base64ToFile

将 Base64 字符串转换为 File 对象

base64ToFile(
    /** Base64 编码的字符串,可以包含 data URI 前缀 @date 2025.07.21 Q */
    base64String: string,
    /** 生成的文件名 @date 2025.07.21 Q */
    filename: string,
    /** 文件的 MIME 类型 @date 2025.07.21 Q */
    mimeType: string
): File;
  • base64ToUint8Array

将 Base64 字符串转换为 Uint8Array

base64ToUint8Array(base64: string): Uint8Array;

日期/时间处理

  • iTimestamp()

解析时间戳, 将时间戳解析成对应的时间格式并输出

iTimestamp(timestamp: number | string | Date, format?: string): string | undefined

timestamp — 时间戳

format — 想要返回的时间格式, 默认: 'yyyy/mm/dd hh:mm:ss.ms'

  • iSecondsToTime()

秒数转时间

iSecondsToTime(num: number, format?: string): string

num — 要转换的秒数

format — 输出的时间格式, 默认'dd:hh:mm:ss'