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

linxd-utils

v1.0.5

Published

常用js工具类

Downloads

8

Readme

本工具类纯个人及团队整理,用于团队项目开发

默认导出 utils import utils from 'linxd-utils'

以下为工具类api 按模块分类

1. index

方法名 | 说明 | 参数 ---- | ----- | ------
utils.uuid() | 返回 36 位uuid函数 string 类型 | - utils.debounce() | 函数节流方法 | func <Function>, wait <Number>, immediate <Boolean>

2. date

方法名 | 说明 | 参数 ---- | ----- | ------
utils.date.formatDate() | 返回格式化的时间 string 类型| 1.date 类型 2.返回的时间格式,默认yyyy-MM-DD HH:MM:SS <String>类型 utils.date.formatTime() | 返回距离当前时间(刚刚,几分钟前,几小时前等) string 类型| (cellValue,type) 1.time <Number> 2.返回的时间格式 yyyy-MM-DD HH:MM:SS 或 yyyy-MM-DD <String>

3. number

方法名 | 说明 | 参数 ---- | ----- | ------
utils.number.numberToString() | 返回大写中文数字 string 类型 | num <Number> utils.number.thousandSplit() | 千位逗号分隔 返回类型 <String> | str <String>

4. bower

方法名 | 说明 | 参数 ---- | ----- | ------
utils.bower.httpToHttps() | 返回 string | url <String> utils.bower.getParams() | 返回 <String> | key <String> 要获取的参数 例: ('id') utils.bower.getBowerType() | 返回 浏览器类型 <String> | --

5. data

方法名 | 说明 | 参数 ---- | ----- | ------
utils.data.treeDataformatter() | 根据id和pid循环出树形结构的数据 | data <List>, id <String> 默认值为 id , pid <String> 默认值为 pid, children <String> 默认值为 children utils.data.orderBy() | 返回排序数组 | 基本类型数组 <Number> 正序 asc 或倒序 desc utils.data.deleteSame() | 返回去重后的数组(基本类型数组) | 基本类型数组 <Array> utils.data.deleteSameByObj() | 返回去重后的数组(list 套 map) | --

6. file

方法名 | 说明 | 参数 ---- | ----- | ------
utils.file.getFileNameExt() | 返回文件名的后缀 | fileName string utils.file.getFileName() | 返回文件名 | fileName string utils.file.isImageType() | 判断是否为图片类型 返回值<Boolean> | fileName string utils.file.isVideoType() | 判断是否为视频类型 返回值<Boolean> | fileName string

7. reg

方法名 | 说明 | 参数 ---- | ----- | ------
utils.reg.email() | 正则验证 返回类型 <Boolean> | <String> utils.reg.mobile() | 正则验证 返回类型 <Boolean> | <String> utils.reg.tel() | 正则验证 返回类型 <Boolean> | <String> utils.reg.idCard() | 正则验证 返回类型 <Boolean> | <String> utils.reg.ip() | 正则验证 返回类型 <Boolean> | <String>