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

windowfn

v2.0.1

Published

* 常用函数封装 * JS方法合集 * JS * 封装

Downloads

4

Readme

windowfn包发布

常用函数封装

  • 使用方法
npm i windowfn -D
#或者
cnpm i windowfn -D
  • 在vue中使用
import fn from 'windowfn';

## 方法调用如下
// js 冒泡排序
fn.bubbleSort(array)
// 平均值,小数点可能会有很多位,这里不做处理,处理了使用就不灵活了!
fn.covArr(arr)
// css样式 id或者class
fn.css(id, index, json)
// 兼容
fn.event(e)
// 清除对象中值为空的属性
fn.filterParams(obj)
// 获取cookie
fn.getCookie(key)
// 到某一个时间的倒计时
fn.getEndTime(endTime)
// 获取css属性值
fn.getStyle(element, attr)
// 获取系统当前时间
fn.getTime(str, type)
// 获取,设置url参数
fn.getUrlPrmt(url)
// 隐藏 id或者class
fn.hide(id, index)
// 插入排序
fn.insertSort(array)
// 方向键上下
fn.keyCode()
// 键盘事件
fn.keybroad()
// 数组最大值
fn.maxArr(arr)
// 数组最小值
fn.minArr(arr)
// 阻止滚动条冒泡事件
fn.preventScroll(id)
// 随机产生颜色
fn.randomColor()
// 随机返回一个范围的数字
fn.randomNumber(n1,n2)
// 随机码
fn.randomNumberOne(count)
// 从数组中随机获取元素
fn.randomOne(arr)
// 删除cookie
fn.removeCookie(key)
// 设置cookie
fn.setCookie(key, value, iDay)
// 设置url参数
// setUrlPrmt({'a':1,'b':2})
// 显示 a=1&b=2
fn.setUrlPrmt(obj)
// 显示
// id或者class
fn.show(id, index)
// 阻止冒泡行为
fn.stopBubble(e)
// 阻止默认行为
fn.stopDefault(e)
// 求和
fn.sumArr(arr)
// js 利用sort进行排序
fn.systemSort(array)
// 千分位处理
fn.toFormatData(num)
// 去重加拼接
fn.toGether(index, array)
// 统计数量
fn.totalNum(val)
// 现金额大写转换函数
fn.upDigit(num)