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

changlin-wdtools

v1.2.4

Published

The functions that be used in the browser environment

Downloads

1

Readme

changlin-wdtools

浏览器环境中使用的一些函数 / The functions that be used in the browser environment

安装

npm i changlin-wdtools --save
//或者
npm install changlin-wdtools --save

使用

//引入模块内函数
import {setCookie} from "changlin-wdtools"

Constants

Functions

hasTransition

Support transition

Kind: global constant

setCookieDefaultConfig(config) ⇒ undefined

修改默认cookie设置

Kind: global function

| Param | Type | | --- | --- | | config | object |

Example

setCookieDefaultConfig({
 maxAge:3600,
path:'/',
domain:'abc.com'
})

getCookie(name) ⇒ string

获取cookie值

Kind: global function

| Param | Type | | --- | --- | | name | string |

Example

getCookie('cookieName')

getCookieObject(name) ⇒ object

获取cookie值,并解析为对象

Kind: global function

| Param | Type | | --- | --- | | name | string |

Example

getCookieObject('cookieName')

setCookie(name, value, attributes) ⇒ string

设置cookie值

Kind: global function

| Param | Type | Description | | --- | --- | --- | | name | string | cookie name | | value | string | number | object | cookie value | | attributes | object | cookie config |

deleteCookie(name) ⇒ string

删除 cookie

Kind: global function

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

searchParse(search) ⇒ object

解析window.location.search

Kind: global function

| Param | Type | | --- | --- | | search | string |

Example

searchParse('?c=4&b=5')//=>{c:4,b:5}

searchStringify(object) ⇒ string

将对象转为字符串,window.location.search格式 (注意返回字符串不含?)

Kind: global function

| Param | Type | | --- | --- | | object | object |

Example

searchStringify({a:'1234'})//=>'a=1234'

searchExtend(arguments) ⇒ string

合并所有参数,返回字符串 (注意返回字符串不含?)

Kind: global function

| Param | Type | | --- | --- | | arguments | object | string |

Example

searchExtend('?a=3&b=4', {b:5}, {b:6,c:7})//=>'a=3&b=6&c=7'

getAbsoluteURL(location) ⇒ string

获取绝对URL

Kind: global function

| Param | Type | | --- | --- | | location | string |

isWeiXin() ⇒ boolean

判断是否为微信浏览器

Kind: global function

isAndroid() ⇒ boolean

判断是否为安卓端

Kind: global function

isIOS() ⇒ boolean

判断是否为IOS端

Kind: global function

requestAnimationFrame(callback) ⇒ number

Kind: global function

| Param | Type | | --- | --- | | callback | function |

cancelAnimationFrame(id) ⇒ undefined

Kind: global function

| Param | Type | | --- | --- | | id | number |

cssPrefix(key) ⇒ string

prefix css

Kind: global function

| Param | Type | | --- | --- | | key | string |

css(el, key, value) ⇒ string

set or get style

Kind: global function

| Param | Type | | --- | --- | | el | object | | key | string | | value | string |

addEventListener(el, type, fn, useCapture) ⇒ undefined

addEventListener

Kind: global function

| Param | Type | | --- | --- | | el | object | | type | string | | fn | function | | useCapture | boolean |

removeEventListener(el, type, fn, useCapture) ⇒ undefined

removeEventListener

Kind: global function

| Param | Type | | --- | --- | | el | object | | type | string | | fn | function | | useCapture | boolean |

findEL(any) ⇒ null | object

Kind: global function

| Param | Type | | --- | --- | | any | * |

findELs(any) ⇒ array

Kind: global function

| Param | | --- | | any |

offset(el) ⇒ Object

Kind: global function

| Param | Type | | --- | --- | | el | object |