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

mkit-utils

v1.0.13

Published

一些工作中常见的业务组件,简单整理了一下,方便以后复用

Downloads

35

Readme

mkit-utils 测试版

业务中部分常用工具封装

storageManage

import {storageManage} from 'mkit-utils'
/**
 * set方法接受三个参数
 * 参数一:key 或者说是数据的名字
 * 参数二:value 需要存入的数据
 * 参数三:expiryTime 有效期,此项为可选项,如果不传则默认永久有效(3年)
 */
storageManage.set(key, value, expiryTime)

/**
 * get方法接受一个参数
 * 当未能在storage中寻找到匹配的数据或数据已经过期,返回undefined否则返回寻找到的数据
 */
storageManage.get(key)
storageManage.remove(key)
/**
 * 清空当前所有数据 
 */
storageManage.clean()
/**
 * 实时监听storage中数据的变化
 */
storageManage.listener(eventName, eventCallback)

EasyMenu

菜单组件,用于将多层嵌套菜单数据渲染成类似antd中的菜单样式,该组件依赖antd,如需使用,项目中必须安装有antd

<EasyMenu
  data={menus} // 嵌套数组格式的菜单数据 必传
  selected={menuSelect} // 菜单项被选中的回调方法 必传

  keyName="path" // 菜单项对应的页面路径 可选 默认为path
  childName="children" // 菜单项对应的子菜单列表名称 默认为children
  titleName="title" // 菜单项对应的标题名称 可选 默认为title
/>

EasyBread

面包屑组件,自动根据当前的页面路径,自动从对应的菜单数据中匹配出对应的面包屑内容,该组件依赖antd,如需使用,项目中必须安装有antd

<EasyBread
  data={menus} // 嵌套数组格式的菜单数据 必传
  selected={menuSelect} // 面包屑被点击的回调方法 必传

  keyName="path" // 菜单项对应的页面路径 可选 默认为path
  childName="children" // 菜单项对应的子菜单列表名称 默认为children
  titleName="title" // 菜单项对应的标题名称 可选 默认为title
/>

EasyTag

标签组件,自动根据当前页面路径,在页面中显示tag标签并进行增加、删除等操作;该组件依赖antd,如需使用,项目中必须安装有antd

<EasyTag
  data={menus} // 嵌套数组格式的菜单数据 必传
  selected={tagClick} // 标签被点击的回调方法 必传
/>