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

arges-libs

v1.0.5

Published

arges内部工具类库

Downloads

21

Readme

介绍

arges-libs 是一个常用函数集锦的工具库,包括浏览器、函数式、常用验证、cookie、数组处理等函数。

安装

// yarn
yarn add arges-libs

// npm
npm install arges-libs

备注:目前 arges-libs 可以在浏览器端使用,暂不支持在 node 端使用。

使用

例如需要判断是否为安卓设备

// 直接引入
import { isAndroid } from 'project-libs';

// 单独引入
import isAndroid from 'project-libs/build/is/isAndroid';

// 使用
if(isAndroid()){
  // 
}

目前支持的函数

| 函数 | 作用 | | --- | --- | | type | 判断元素类型 | | cookie | 操作cookie,包括查询、修改、删除 | | copy | 复制到剪切板 | | createLink | 在 head 中创建 css 的 link 标签 | | createScript | 创建 script 标签 | | getScrollTop | 获取浏览器滚动条位置 | | createLink | 在 head 中创建 css 的 link 标签 | | getScrollTop | 获取浏览器滚动条位置 | | scrollToTop | 滚动到浏览器顶部 | | urlGet | 获得URL中GET请求的参数值 | | urlParams | 将键值对拼接成URL带参数 | | sleep | 睡眠函数,延迟执行 | | timestamp | 获取当前时间戳 | | timeBeauty | 时间美化函数 | | curry | 用来柯里化的函数 | | compose | 组合函数,从右向左依次执行 | | pipe | 管道函数,从左向右依次执行 | | debuonce | 防抖函数 | | throttle | 节流函数 | | replace | 可以根据指定的选项来替换内容 | | clone | 浅拷贝,才方法只针对普通对象{}和数组[] | | deepClone | 深层次克隆 | | compare | 判断两个变量是否相等, 此方法用于相同数据类型的变量比较 | | json2FormData | 对象转为 formdata | | pick | 从对象中根据特定的属性返回一个新的对象 | | base64 | base64 转码和解码操作 | | arrayUnique | 数组去重 | | arrayIndex | 获取某个元素下标,元素可以为对象 | | arrayGroup | 把数组均分成几等份,并返回一个新的数组 | | arraySearchByKey | 查询数组相应的key,返回一个新的数组 | | arrayToTree | 扁平化数组转树解构-递归方式 | | isEmpty | 判断空对象,空数组,空字符串 | | isAndroid | 判断是否是安卓设备 | | isApple | 判断是否是苹果设备 | | isIos | 判断是否是 ios 设备 | | isPhone | 验证是否是电话号码,可以自定义第二个号码 | | isEmail | 判断邮箱是否正确,可以自定义邮箱后缀 | | isMobile | 判断是否为手机端 | | isIP | 校验是否为不含端口号的IP地址 | | isIDCard | 验证是否为第二代居民身份证 | | isPostCode | 验证是否为邮政编码 | | isQQNumber | 验证是否是 qq 号码 |