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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hoolinks

v0.1.5

Published

主要封装一些一些通用的工具函数方法,如http请求(get,post),实体映射,store操作类等。

Downloads

3

Readme

hoolinks

主要封装一些一些通用的工具函数方法,如http请求(get,post),实体映射,操作类等。

use

npm install hoolinks --save 
or
yarn add hoolinks

API

  • request

    import {post,get} from 'hoolinks/request';
    get('url',parms,headerOptions) //返回值:Promise
    post('url',parms,headerOptions) // 返回值:Promise
    
  • json-mapper-object

    import {JsonProperty,MapperEntity} from 'legions/json-mapper-object';
  • observable-promise(vuex)

    //结合vuex使用
    import {observablePromise} from "hoolinks/observable-promise"; //主要用于统一前端数据体结构 
  • observable-promise(mobx)

    //结合mobx使用
    import {observablePromise,ObservableTempState} from "hoolinks/mobx"; //主要用于统一前端数据体结构 
    
      @observable obRepositoryList=observablePromise();//初始化
      @observable obAddResult=new ObservableTempState();//初始化 临时变量 用完需要初始化 可通过实例上面clear方法进行初始化
    
      this.obRepositoryList=observablePromise(getRepositoryList(repoName,page,pageSize));//参数传递一个Promise 一般直接是service接口
    
      this.obRepositoryList=new ObservableTempState(getRepositoryList(repoName,page,pageSize));//参数传递一个Promise 一般直接是service接口
  • promise-action

    import { PromiseAction } from 'hoolinks/promise-action';  //vue 发送dispatch
    
    new PromiseAction().set(dispatch,type,promise) 
    // dispatch vuex 底层dispatch函数,
    // type action 类型 值为字符串
    // promise 接口请求 值为一个promise  此操作vuex state数据类型一定要是 observablePromise 生成的对象
    
  • date-format

    import { formatDate,formatDateToFriendly,formatDurationToFriendly,isLeapYear,countDays,getLastDay} from 'hoolinks/date-format';  
    formatDate(date,fmt);//
    formatDateToFriendly(date)
    formatDurationToFriendly(number) 数字
    isLeapYear(date)
    countDays(date,date1)//两时间间隔天数
    getLastDay(date)
  • str-format

    import { amount,number,formatLocaleString,formatTrim} from 'hoolinks/str-format'; 
    
    amount(value);//
    number(value,size)
    formatLocaleString(value)//千位分割
    formatTrim(str)//首尾去除空格
  • download

    import {download} from 'hoolinks/download'; 
    
    download(urls);//
  • cookie

    import {clearAllCookie,removeCookie,getCookie,setCookie} from 'hoolinks/cookie'; 
    setCookie(name,value,Day);
    clearAllCookie();//
    removeCookie(name);
    getCookie(name);
  • regex

    import {RegExChk,validatorType} from 'hoolinks/regex'; 
    validatorType 常规正则验证类型枚举
    RegExChk(type,value);// type可以是常规正则验证类型 validatorType ,或者也可以是一个自定义正则表达式 : /^[\u0391-\uFFE5]+$/
  • form-rule

    import {FormRuleProperty,createFormRule} from 'hoolinks/form-rule'; 
      
    class FormInfo{
          @FormRuleProperty({
              required: true,
              name: 'billNo',
              error: '收付单号格式不正确',
              desc: '收付单号',
              trigger:'blur,change',//默认blur,change
              regex:/^[1-9]\d*$/ //自定义验证规则
              validator:(value,error,callback)=>{ //自定义验证规则
    
              }
          })
          billNo='112';
    
          @FormRuleProperty({
              required: true,
              name: 'bussinessMan',
              error: '业务员格式不正确',
              desc: '业务员',
          })
          bussinessMan=void 0;
    
          @FormRuleProperty({
              required: true,
              name: 'saleDate',
              error: '交易日期格式不正确',
              desc: '交易日期',
              type:"array"
          })
          saleDate=void 0;
    
          @FormRuleProperty({
              required: true,
              name: 'amount',
              error: '总金额格式不正确',
              desc: '总金额',
          })
          amount=void 0;
    
          @FormRuleProperty({
              required: true,
              name: 'settleType',
              desc: '结算方式',
          })
          settleType=void 0;
    
          @FormRuleProperty({
              required: true,
              name: 'filePath',
              desc: '附件',
          })
          filePath=void 0;
     }
    
     class FormInfoRule extends FormInfo{
          constructor(){
              super();
              createFormRule(FormInfo,this);
          }
       
     }

Licensing

MIT license