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

xpxtool

v0.0.1

Published

./index.js

Downloads

3

Readme

xpxtool

NPM version

Front end tool library for xpx.

Install

You can get xpxtool via npm.

npm install xpxtool -D

Usage

存储数据

Storage

import * as xpxtool from 'xpxtool';

xpxtool.setSessionStorage('test', '123');

更多接口>>

Develop

# dev
npm run dev

# build
npm run build

# documentation
npm run docs

# publish
npm run release

开发使用注释方法

|名称 |作用 |备注| |:-----: |:-----: |:-----:| |@param| 参数描述 |仅供类、接口、方法注释时使用。同一个注释块可同时出现多个param描述。| |@return |返回描述 |仅供方法注释时使用。除void方法外其它所有方法必须有一个return描述。| |@throws |异常描述 |零到多个。| |@exception |异常描述 |零到多个。| |@author |作者 |类和接口注释中必须有。可有零到多个。| |@version |版本描述 |类和接口注释中必须有。零或一个。| |@see |参考描述 |可有零到多个。| |@since |起始版本 |只有一个。| |@serial |序列化描述 |或@serialField或@serialData,可有多个| |@deprecated |废除标志 |最多一个。|

browser

|方法名 | 描述| |:-----: |:-----: | |getBrowserType| 返回浏览器信息|

common

|方法名 | 描述| |:-----: |:-----: | |checkPermission| 判断权限| |compatibleExist| 不存在返回 ——| |debounce| 去抖| |deepClone| 深拷贝,支持常见类型| |generateRndNum| 生成随机数| |generateUniqueNum| 根据时间生成唯一标志的数字| |handleParam| 删除对象里面value值为null或''的键值对|

class

|方法名 | 描述| |:-----: |:-----: | |addClass| 节点添加指定class| |hasClass| 判断节点是否有指定class| |removeClass| 节点删除指定class|

digitUppercase

|方法名 | 描述| |:-----: |:-----: | |digitUppercase| 现金额转大写|

exportXls

|方法名 | 描述| |:-----: |:-----: | |exportXls| blob数据导出| |downFile| blob数据excel下载|

math

|方法名 | 描述| |:-----: |:-----: | |addMath| 数字计算加法| |subMath| 数字计算减法| |mulMath| 数字计算乘法| |divMath| 数字计算除法| |floatFixed| 浮点数保留指定位|

query

|方法名 | 描述| |:-----: |:-----: | |stringfyQueryString| 对象序列化| |getQueryParam| 获取地址栏 ? 后面的参数|

regexp

|方法名 | 描述| |:-----: |:-----: | |isEmail| 判断是否为邮箱地址| |isIdCard| 判断是否为身份证号| |isPhoneNum| 判断是否为手机号| |isSpecialChar| 检查是否为特殊字符| |isRightBankCard| 验证银行卡号| |isRightCardDate| 验证信用卡有效期| |isRightSafeCode| 验证信用卡安全码| |getCheckPrice| 价格处理| |getCheckNumber| 数字处理| |keepDecimals| 价格向下取值保留2位小数| |regExpUtil| 正则|

scroll

|方法名 | 描述| |:-----: |:-----: | |getScrollTop| 获取滚动条距顶部的距离| |scrollTo| 设置滚动条距顶部的距离|

storage

|方法名 | 描述| |:-----: |:-----: | |setCookie| 设置 Cookie| |getCookie| 获取 Cookie| |delCookie| 删除 Cookie| |setSessionStorage| 存储数据到 sessionStorage| |getSessionStorage| 获取数据到 sessionStorage| |delSessionStorage| 删除数据 sessionStorage| |setLocalStorage| 存储数据到 localStorage| |getLocalStorage| 获取数据到 localStorage| |delLocalStorage| 删除数据 localStorage|

time

|方法名 | 描述| |:-----: |:-----: | |formatPassTime| 格式化${startTime}距现在的已过时间| |formatRemainTime| 格式化现在距${endTime}的剩余时间| |isLeapYear| 是否为闰年| |getMonthDays| 获取指定日期月份的总天数| |getChangeTime| 用于时间选择值转换| |getParseTime| 用于时间值格式化转换|

navigatorBridge

|方法名 | 描述| |:-----: |:-----: | |getUserAgent| ios注册bridge| |callHandler| ios注册bridge页面回调函数默认处理,实际使用callHandler,只限ios| |appBridge| 安卓/ios交互处理|