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

wjsljc-utils

v0.1.1

Published

wjsljc-utils是一款极简的前端utils工具库,该库包含了前端工作中常用的utils函数。

Downloads

47

Readme

介绍

wjsljc-utils是一款极简的前端utils工具库,该库包含了前端工作中常用的utils函数。

该库采用TypeScript构建

文档地址

快速上手

$ npm install wjsljc-utils -g

使用

标签引用

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>wjsljc-utils</title>
  <script src="wjsljc-utils.js"></script> 
</head>
<script>
  console.log(utils.makePrivacyToMobile('15680869152'))
</script> 
</html>

在VUE中使用

<script>
  import utils from 'wjsljc-utils';
 
  export default {
    created() {
      console.log(utils.makePrivacyToMobile('15680891522')); // 156****1522
    },
  };
</script>

如果您使用了如webpack或者parcel等构建工具,使用方式于VUE等同。

部分源码展示:

function extend<T, U>(to: T, ...from: U[]): T & U {
  for (let i = 0, len = from.length; i < len; i++) {
    for (const key in from[i]) {
      ;(to as T & U)[key] = from[i][key] as any
    }
  }
  return to as T & U
}
 
function deepMerge(...objs: any[]): any {
  const result = Object.create(null)
  objs.forEach(obj => {
    if (obj) {
      Object.keys(obj).forEach(key => {
        const val = obj[key]
        if (isPlainObject(val)) {
          if (isPlainObject(result[key])) {
            result[key] = deepMerge(result[key], val)
          } else {
            result[key] = deepMerge(val)
          }
        } else {
          result[key] = val
        }
      })
    }
  })
  return result
}