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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lsky/tools

v1.0.6

Published

一个工具库

Downloads

23

Readme

tools

一个工具库

Type

类型检查

| Name | Type | Return | Description | | :---------- | :----- | :------ | :-------------------- | | getType | any | string | 返回参数的类型 | | isType | String | Boolean | 判断是否是指定Type | | isNull | any | Boolean | 判断是否是Null | | isUndefined | any | Boolean | 判断是否是Undefined | | isArray | any | Boolean | 判断是否是Array | | isObject | any | Boolean | 判断是否是Object | | isNumber | any | Boolean | 判断是否是Number | | isString | any | Boolean | 判断是否是String | | isFunc | any | Boolean | 判断是否是Function | | isDate | any | Boolean | 判断是否是Date | | isError | any | Boolean | 判断是否是Error | | isRegExp | any | Boolean | 判断是否是RegExp | | isMap | any | Boolean | 判断是否是Map | | isSet | any | Boolean | 判断是否是Set | | isSymbol | any | Boolean | 判断是否是Symbol | | isPromise | any | Boolean | 判断是否是Promise | | isNan | any | Boolean | 判断是否是Nan |

Value

有关值操作

| Name | Type | Return | Description | | :------- | :----------------------- | :-------------------- | :------------------------- | | isEmpty | any | Boolean | 是否为空值 | | toUnique | Array | Set | Array | 去重 | | checkNum | String | String | 校验数值字符串,并且格式化 | | obtain | (value: any, key: string | number, default: null | any) => any | any | 取值操作,支持返回默认值 |

Request

请求封装

| Name | Type | Return | Description | | :------ | :----- | :----- | :---------- | | request | Object | Null | 请求 |

Browser

浏览器

| Name | Type | Return | Description | | :------------- | :----------------------------------------- | :----- | :------------- | | buildScheme | Object | String | 创建 Scheme | | generateIntent | (config: Object, Option: Object) => String | String | 创建 Intent | | getBrowser | Null | Object | 判断浏览器类型 |

Dom

| Name | Type | Return | Description | | :--------------- | :--------------------------------------------------- | :--------------------- | :------------- | | addEventListener | (dom, eventType, cb, option) => {remove: () => void} | { remove: () => void } | 注册事件 | | getParent | (dom, target: String | Element) => null | Element | null | 获取指定父元素 | | isBrowser | Function | Boolean | 判断是否是浏览器 | | injectScript | (url: String, id: String) => Element | Element | 插入 Script 标签 | | checkTargetModuleHaveLoaded | (cb: Function, condition: Function, params: {count: Number, time: Number, fail: Function}) => void | void | 循环检查 |

UUID

| Name | Type | Return | Description | | :------ | :--- | :----- | :---------- | | shortID | Null | String | 生成 UUID |

Debounce

| Name | Type | Return | Description | | :------- | :---------------------------------- | :------- | :---------- | | debounce | (func, wait, immediate) => Function | Function | 防抖 |

Throttle

| Name | Type | Return | Description | | :------- | :----------------------- | :------- | :---------- | | throttle | (func, wait) => Function | Function | 节流 |

Date

| Name | Type | Return | Description | | :---------------------- | :--------------------------------------- | :---------------- | :---------------- | | replaceTargetDateFormat | (fmt: string, tar: string, value: string | number) => string | string | 给定 fmt 中替换指定 value | | format | (fmt: string, date: Date | string | number) => string | string | 根据 format 格式化时间 |