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

@tripmini/utils-mp

v0.0.5

Published

使用微信小程序环境中的一些处理方案

Downloads

2

Readme

@tripmini/utils-mp

@tripmini/utils-mp是一个工具集,提供了以下可在微信小程序环境中使用的工具与方案

Request

Request用于发送Http请求,思想类似于axios,提供了一些Hooks方便在请求时候对请求体及响应体做一些编辑操作等

另外提供了RequestCancel类来用于取消使用Request发出的请求

BrowseTimer

BrowseTimer用于在微信小程序中统计对某一页面访问时长,方便的将页面总查看时间片段累计并在页面卸载时进行反馈

Cache

Cache是一个Map结构,其继承于Map并增加了常用方法

compareVersion

compareVersion方法用于比较两个版本号大小

debounce

debounce用于对一个函数进行防抖操作

envConsts

envConsts定义了当前运行各种环境判断

EventEmit

EventEmit事件订阅发布模型,类似Vue中的$on/$off系列方法

Loading

Loading封装了wx.showLoadingwx.showToast等方法

Logger

Logger提供了日志上报的功能,并运行自定义上报字段

randomID

randomID提供了一个生成随机数ID的功能,类似于uuid结果

Router

Router在微信小程序中对路由跳转的封装

wait

wait方法提供了一个可以配合await关键字实现类似于Sleep的功能

WaitGroup

WaitGroup类提供了简化版GO语言中WaitGroup的思想

dayjs

dayjs()高度类似于moment用于处理时间,https://github.com/iamkun/dayjs

MD5

md5()是一个生成md5值的方法

DiffMatchPatch

DiffMatchPatch类是Google推出的一个diff计算工具,https://github.com/google/diff-match-patch