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

mim-tool-kit

v1.0.0

Published

Formatting Kit

Downloads

3

Readme

formatDate

日期时间格式化

参数

  • @param1 <string | number> time
  • @param2 type

示例,用符号占位,可以任意组合 # const time = '2022-1-1 10:11:12'; # # formatDate(time, 'yyyy年MM月dd日 hh时mm分ss秒'); // 2022年01月01号 10时11分12秒 #

符号    |   名称
----    |   ----
yyyy    |   年
MM      |   月
dd      |   日
hh      |   小时
mm      |   分钟
ss      |   秒

encrypt

加密

参数

  • @param1 data

示例 # const target = '5863538192fa472b9090161b974823bc'; # # const result = encrypt(target); // 5E6N5N8L9Of4J29M9M1K19J4E2Nb #

decrypt

解密

参数

  • @param1 data

示例 # decrypt(result); // 5863538192fa472b9090161b974823bc #

arrRepeat

数组去重

参数

  • @param1 arr
  • @param2 <...args> args 可变参数

示例 # const arr = [{id:1,name:11},{id:2,name:11},{id:1,name:22},{id:1,name:22}]; # # arrRepeat(arr, 'id'); // [{id:1,name:11},{id:2,name:11}] # # arrRepeat(arr, 'name'); // [{id:1,name:11},{id:1,name:22}] # # arrRepeat(arr, 'id', 'name'); // [{id:1,name:11},{id:2,name:11},{id:1,name:22}] #

arrDelayer

树形结构扁平化

参数

  • @param1 arr

示例 # const tree = [{id:'1',children:[{id:'1-1'},{id:'1-2'}]}]; # # arrDelayer(tree, 'id'); // [{id:'1'},{id:'1-1'},{id:'1-2'}]; #

deepCopy

深复制

参数

  • @param1 json

示例 # const copy = {id:'1',colors:{red:1}}; # # deepCopy(copy); // {id:'1',colors:{red:1}} #

jsonToStr

json转字符串

参数

  • @param1 json

示例 # jsonToStr({id: 1,name: 2}); // id=1&name=2 #

strToJson

字符串转json

参数

  • @param1 str

示例 # strToJson('id=1&name=2'); // {id: 1,name: 2} #