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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-common-rexsheng

v0.0.1

Published

A Vue.js project

Downloads

8

Readme

vue-common-rexsheng

A Vue.js plugin for proving common operation

Build Setup

# install plugin
npm install vue-common-rexsheng --save-dev

# config in entry file like 'src/main.js'
import common from 'vue-common-rexsheng';
# 配置localstorage根key,不配置默认:"vue"
Vue.use(common,{storageKey:"testRoot"})

提供扩展方法如下

|方法 | 说明 | 备注 | |------ |--------------- |:-----:| |last() |返回数组最后一个值,参数无 | 例如["a","b","c"].last()="c"| |first() |返回数组第一个值,参数无 | 例如["a","b","c"].first()="a" | |insert(index, obj) |在数组index索引处(0开始)插入新值,返回当前数组 | | |remove(obj) |移除数组中所有的obj,返回当前数组 | | |removeAt(index) |移除数组中索引处的值,返回移除的对象 | | |distinct() |返回去重后的数组 | | |sum() |数组值相加,返回求和结果 | | |skip(length) |跳过数组前length条,返回新数组 | | |take(length) |取数组前length条,返回新数组 | | |range(start, end) |取数组索引 >= start且索引 < end的新数组 | | |group(key) |对象数组,按照key分组,返回新数组格式[{"key":"key1","value":[]},{"key":"key2","value":[]}] | [{"name":"tom","age":12},{"name":"jack","age":16},{"name":"ali","age":12}].group("age")=[{"key":12,"value":[{"name":"tom","age":12},{"name":"ali","age":12}]},{"key":16,"value":[{"name":"jack","age":16}]}]| |formatString(args) |字符串格式化 |"a{id}".formatString({id:"小米"})="a小米" "a{0}b{1}c{0}".formatString("发","财")="a发b财c发" "a{0}b{1}c{0}".formatString(["发","财"])="a发b财c发" | |contains(str) |字符串是否包含参数str | | |leftPadding(char, length) |左侧填充字符串 | char用来填充的字符,length要求的字符串总长度| |toMD5(bit) |字符串转md5值 | bit位数默认32,可选32 64,例如"123456".toMD5(32)="e10adc3949ba59abbe56e057f20f883e"| |btoa() |字符串base64加密 | | |atob() |字符串base64解密 | | |Vue.cookie.set(name, value, time) |cookie设置,time单位为秒 | Vue全局可用| |this.$cookie.set(name, value, time) |同上 |页面实例使用 | |Vue.cookie.get(name) |cookie获取,获取不到返回undefined | Vue全局可用| |this.$cookie.get(name) |同上 |页面实例使用 | |Vue.cookie.del(name) |cookie删除 | Vue全局可用| |this.$cookie.del(name) |同上 |页面实例使用 | |Vue.storage.set(key, value) |localstorage设置 | Vue全局可用 this.$storage.set("a",{name:"abc"}) this.$storage.set("a.c",["生","xu"]) this.$storage.set("ff.gg",{age:12}) Vue.storage.set("abc.efg",45)| |this.$storage.set(key, value) |同上 |页面实例使用 | |Vue.storage.get(key) |localstorage获取 | Vue全局可用this.$storage.get("a") this.$storage.get("abc.efg")| |this.$storage.get(key) |同上 |页面实例使用 | |Vue.storage.clear(key) |localstorage删除,不写key时,删除全部 | Vue全局可用this.$storage.clear("abc.efg") this.$storage.clear()| |this.$storage.clear(key) |同上 |页面实例使用 | |this.$setInterval(fn,timeMilliseconds) |页面循环调用 |页面销毁同时自动销毁 | |this.$setTimeout(fn,timeMilliseconds) |页面定时器 |页面销毁同时自动销毁定时器 | |this.$fullScreen() |全屏 | | |this.$exitFullScreen() |退出全屏 | | |this.$bind(elm, event, fn) |绑定事件 | | |this.$unbind(elm, event, fn) |解除绑定事件 | | |this.$file.readAsText(file, encoding) |读取文件text模式,返回Promise | encoding文件编码GBK或其他。this.$file可用作全局Vue.file| |this.$file.readAsDataURL(file) |读取文件图片URL模式,返回Promise | | |this.$file.readAsBinaryString(file) |读取文件二进制字节模式,返回Promise | | |this.$file.readAsArrayBuffer(file) |按字节读取文件内容,结果用ArrayBuffer对象表示,返回Promise | | |this.$file.loadCsv(strData, strDelimiter) |读取csv | strData数据,strDelimiter分隔符默认逗号, | |this.$file.loadXml(xmlString) |读取xml | |

For detailed explanation on how things work, consult the docs for vue-common-rexsheng.