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

jsfunc

v0.1.9

Published

常用的js func

Downloads

17

Readme

Functions

isEmtryObject(obj) ⇒ Boolean

[isEmtryObject 判断Object是否为空对象]

Kind: global function
Returns: Boolean - [返回结果布尔值]

| Param | Type | Description | | --- | --- | --- | | obj | object | [obj] |

objectAssign(obj1, obj2) ⇒ object

[objectAssign Object合并覆盖]

Kind: global function
Returns: object - [description]

| Param | Type | Description | | --- | --- | --- | | obj1 | Object | [被覆盖对象] | | obj2 | Object | [覆盖对象] |

Browser([uaStr]) ⇒ object

放置浏览器相关信息返回

Kind: global function

| Param | Type | Description | | --- | --- | --- | | [uaStr] | string | 测试ua |

setCookie(name, value, day)

[setCookie 设置cookie]

Kind: global function

| Param | Type | Description | | --- | --- | --- | | name | string | [cookie变量名] | | value | string | [cokkie值] | | day | number | [保存时间,单位:天,默认1天] |

getCookie(name) ⇒ string

[getCookie 获取cookie]

Kind: global function
Returns: string - [description]

| Param | Type | Description | | --- | --- | --- | | name | string | [cookie name] |

deleteCookie(name)

[deleteCookie 删除cookie]

Kind: global function

| Param | Type | Description | | --- | --- | --- | | name | string | [name] |

getQueryString(name) ⇒ string

[getQueryString 获取url请求参数]

Kind: global function

| Param | Type | Description | | --- | --- | --- | | name | string | [参数名] |

formatTimeStamp(str, format) ⇒ string

formatTimeStamp 时间格式化转换

Kind: global function
Returns: string - [指定时间格式结果]

| Param | Type | Description | | --- | --- | --- | | str | number | [时间戳] | | format | string | [时间格式,[YY|YYYY]年 [mm|m]月 [dd|d]天 [hh|h]时 [ii|i]分 [ss|s]秒] |

countDown(endTimeStamp, options) ⇒ string

倒计时

Kind: global function
Returns: string - 倒计时结果,小时:分:秒

| Param | Type | Description | | --- | --- | --- | | endTimeStamp | number | 倒计时结束时间戳 | | options | Object | 配置 showDouble,utils,info |

diffTime(label, isStar)

计算代码执行diff时间

Kind: global function

| Param | Type | Description | | --- | --- | --- | | label | * | 日志标识 | | isStar | * | 开始执行时间标记 |

transformImageSize(size, imgsrc) ⇒ string

裁剪cdn图片

Kind: global function
Returns: string - url

| Param | Type | Description | | --- | --- | --- | | size | number | 需要裁剪的尺寸 | | imgsrc | string | 需要裁剪的图片url |

concatClass() ⇒ string

react classname 拼接

Kind: global function

getRelesestage() ⇒ string

判断当前环境

Kind: global function
Returns: string - development || pre_product || localhost || product

adapter(data, distkv)

数据转换器

Kind: global function

| Param | Type | Description | | --- | --- | --- | | data | object | 需要转换的数据 | | distkv | object | 输出的键值对 |

throttling(fn, wait)

节流

Kind: global function

| Param | Type | Description | | --- | --- | --- | | fn | function | 行为函数 | | wait | number | 时间间隔(ms) |

antiShake(fn, wait)

防抖

Kind: global function

| Param | Type | Description | | --- | --- | --- | | fn | function | 行为函数 | | wait | number | 防抖时长(ms) |