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 🙏

© 2024 – Pkg Stats / Ryan Hefner

raintools

v0.0.8

Published

TS type tool library

Downloads

9

Readme

文档介绍

本人自己的 tools 库,已上传至 npm (raintools)[https://www.npmjs.com/package/raintools]

1、校验数据类型 prototype-typeof.ts

prototypeTypeof('raintools')  // string

2、手机号脱敏

hideMobile('12345674569') // 123****4569

3、防抖、节流、深拷贝

debounce()
throttle()
cloneDeep()

4、大小写转换

turnCase('rain',1)

5、前端生成 uuid

uuid()

6、金额格式化

moneyFormat(10000,2,'_',',')

7、封装本地存储工具 localStorage

localCache.setItem('name','rain')

8、封装本地存储工具 sessionStorage

sessionCache.setItem('name','rain')

9、模糊搜索

fuzzyQuery(list,'rain','id')

10、判断一个对象是否为空

isObjectEmpty(obj)

11、不影响原始数组的排序方法

originaUnchangedSort(arr)

12、获取随机值

getRandomNumberByRange(0,100)

13、获取 字符串中 第一个 中文

getFirstChineseString('2021年12月') // 年

14、验证是否是手机号

phoneValidator('123456789')

15、验证是否是邮箱号

emailValidator('123456789')

16、字符串排序方式

/**
 * 字符串排序方式
 * 数字第一 按从 小到大的顺序
 * 英文第二 按 A-Z 的顺序
 * 中文第三 按 第一个 中文 a-z 的顺序
 * 
*/
const arr = [
    {
        "id": 2155,
        "value": '100',
    },
    {
        "id": 2156,
        "value": 'dsa',
    },
    {
        "id": 2160,
        "value": '雨',
    },
]
stringSort(arr,'C_PARAM_NAME')

17、切换全屏

triggerFullscreen(element)