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

bristlegrass

v1.0.2

Published

This is a collection of front-end tool methods

Readme

bristlegrass

前端常用工具方法集合

安装

npm i bristlegrass 

使用

const bt = require('bristlegrass')

bt._number.getRandomNum(2)

*说明:具体方法的说明信息可以参考 src/modules下的文件 *

_number 数字类型数据算法集合

getRandomNum

获取15位以内的随机数

_string 字符串类型数据算法集合

getParamByUrl

获取url中的参数

_array 数组操作算法集合

removeDistinct

数组去重

_object 对象操作算法集合

deepCopy

引用类型深拷贝

getSingle

生成单例

_function 方法相关操作

debounce

函数防抖

throttle

函数节流

_tree 树结构数据操作算法集合

convertToTreeData

对象数组转换成多叉树

convertTreeToFlatData

多叉树转换成对象数组

createTreeByClone

从多叉树创建另一个多叉树数据

_dom html文档操作相关方法集合

getParentsByDeep

找元素的第n级父元素

hasChildren

判断元素有没有子元素

_sort 排序算法集合

insertSort

插入排序

bubbleSort

冒泡排序

quickSort

快速排序

_regexp 正则表达式集合

contactWay

手机号和固话

mobile

手机号(包含港澳台)

phone

固定电话

intOrTwoDecimal

匹配整数或者最多两位小数的数字

personID

身份证号码

remark

中英文数字,常用的标点符号验证

emoji

表情符号

email

邮箱

_global 通用方法集合

getType

获取数据类型