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

lv-tools

v0.0.27

Published

lv_tool(工具中的LV)是一个前端的工具包,使前端开发如鱼得水,它具有以下的特点: - 装笔性:有利于向他人展示代码的美好🐶 - 不严谨性: 作者能力有限,水平还在提升中🆙 - 不负责任性:想用的话,自己看着办吧👀...

Readme

lv_tools

lv_tool(工具中的LV)是一个前端的工具包,使前端开发如鱼得水,它具有以下的特点:

  • 装笔性:有利于向他人展示代码的美好🐶
  • 不严谨性: 作者能力有限,水平还在提升中🆙
  • 不负责任性:想用的话,自己看着办吧👀...

Installation

npm install lv_tools

Use

improt { lv_typeOf } from lv_tools

String相关

lv_typeOf:(obj:any) => string
"[object Boolean]": "boolean",
"[object Number]": "number",
"[object String]": "string",
"[object Function]": "function",
"[object Array]": "array",
"[object Date]": "date",
"[object RegExp]": "regExp",
"[object Undefined]": "undefined",
"[object Null]": "null",
"[object Object]": "object",
将参数百分位以逗号分割
lv_thousandBitSeparator:(param:number | string) => string
将参数百分位以逗号分割,并保留n位小数
lv_moneyFormat:(param:number | string, n:number) => string
判断字符串是否是十六进制的颜色值
lv_isColor:(param:string) => boolean
隐藏用户手机号中间四位
lv_hidePhone:(param:string) => string
生成UUID
lv_uuid:(len:number, radix:number) => string

Object相关

判断对象是否有键
lv_objHasKey:(param:object) => boolean
深拷贝
lv_deepClone:(params:object) => object
函数节流
lv_throttle:(fn:Function, awat = 50) => fn
* 滚动加载,加载更多或滚到底部监听
* 高频点击提交,表单重复提交
函数防抖
lv_debounce:(fn:Function, awat = 50) => fn
* 搜索框搜索输入。只需用户最后一次输入完,再发送请求
* 手机号、邮箱验证输入检测
* 窗口大小Resize。只需窗口调整完成后,计算窗口大小。防止重复渲染。

date相关

日期/时间格式化
lv_dateFormat(param:Date, type?:string) => string
type: yyyy-MM-dd hh:mm:ss
日期/时间间隔 interval:毫秒
lv_timeCountDown(interval: number|string) => obg:Iobj
Iobj:{day,hour, minute,second}

array相关

数组对象,通过指定key生成map
lv_generateMap(array:obj[], key:string) => obj
数组对象,通过指定key去重
lv_uniqueArrayObject(array:obj[], key:string) => obj[]
普通数组去重
lv_uniqueArray(array) => array
数组构建树结构
lv_generateTree(array,id = "id",parentId = "parentId",children = "children") => obj
树结构拉平
lv_flaTree(array,children = "children") => obj[]

observe

lv_observe {
  subscribe(type:string, fn:callback),
  publish(type:string|obj, value),
  unSubscribe(undefined|string)
}