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

ys-tools

v0.0.2

Published

宇石工具库

Downloads

3

Readme

ys-tools

不断新增工具的工具函数库

功能简述

包含以下方法
## 生成随机字符串
randomWord

## md5加密
md5

## sha1加密
sha1

## cookie操作
jsCookie

## 获取路由参数
getQueryString

## 汉字转拼音
vPinyin

## 上传阿里云
uploadAliyun

## 文件流下载
downloadFileStream

## 手机系统环境信息
ua

## 深拷贝
deepClone

## 数组函数
arrFun

安装使用

## 安装依赖
npm i || yarn || cnpm ys-tools
## 引入使用
import { randomWord, md5, sha1, jsCookie, vPinyin, getQueryString } from 'ys-tools'

randomWord(min, max) 生成随机长度min至max之间的随机字符串
randomWord(min) 生成长度min的随机字符串

md5(string) 使用同md5
sha1.sha1(string) 使用同sha1

jsCookie 使用同‘js-cookie’

vPinyin.chineseToPinYin('中文') 汉字转拼音

getQueryString(name) 取名为name的路由链接参数

uploadAliyun(params: object, file: object, fileName: string) params阿里云所需参数(此参数由自定义后端接口返回),file文件,fileName下载文件名
downloadFileStream(downloadUrl: string, params: object, fileName?: string, timeout?: number) downloadUrl下载请求接口地址,params下载请求所需参数,fileName下载文件名,timeout超时时长

ua 系统信息
ua.browser 浏览器类型和版本
ua.os 操作系统类型

deepClone 深拷贝

arrFun 数组
arrFun.arrayEqual 判断两个数组是否相等,参数(arr1,arr2)两个数组,返回布尔值
arrFun.deDuplicateArray 根据数组中某个对象值去重,参数(数组,健:string),返回去重后的数组
arrFun.removeEmptyArrays 传入两层数组[[],[开始时间, 结束时间],[]],去除数组中空数组,返回去空后的数组

#更新记录

[email protected] 初始化

#issuse

有问题欢迎@无心