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

hsja_tools

v0.1.4

Published

前端公共工具库 内置lodash-es 封装多个常用业务场景工具 致力提升开发效率 多点时间摸鱼

Readme

前端常用工具库

快速开始

  • 安装npm包
npm i hsja_tools -S
pnpm install hsja_tools -S
  • 打包工具使用方式
// webpack
const HsjaTools = require('hsja_tools')
console.log(HsjaTools.isArray([0,1,2]));

// es 全部导入
import HsjaTools from 'hsja_tools'

console.log(HsjaTools.isArray([0,1,2]));

// es 按需导入
import {isArray} from 'hsja_tools'

console.log(isArray([0,1,2]));
  • 直接html script直接引入 dist目录下的js文件 注意:umd 格式文件会暴露一个全局变量 HsjaTools
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>test测试</title>
    <script type="module">
        <!--es module 模式-->
        import {isArray} from "./dist/hsja-tools.js";
        console.log('isArray', isArray([1,2,3]));
        // 函数内调用
        function getIsArray(value){
            import('./dist/hsja-tools.js').then(tools => {
                const {isArray} = tools
                console.log('getIsArray', isArray(value))
            })
        }
        getIsArray([4,5,6])

        // async await 方式
        async function getHsjaTools(){
            return await import('./dist/hsja-tools.js')
        }
        const {isNumber} = await getHsjaTools()
        console.log('isNumber', isNumber(5))
    </script>
    
    <!--umd 格式文件 暴露一个全局变量 HsjaTools-->
    <script src="./dist/hsja-tools.umd.cjs"></script>
    <script>
        console.log(HsjaTools)
        console.log(HsjaTools.isArray([11]));
    </script>
</head>
<body>
</body>
</html>

pnpm Monorepo教程

## pnpm Monorepo安装包命令
pnpm --filter <package_selector> <command>

## 示例 @packages/utils 安装dayjs
pnpm --filter @packages/utils add dayjs

## 示例 公共安装dayjs
pnpm add dayjs -w

大概思路

  1. core里面写一些 公共的原子函数 比如 isObject
  2. utils里面写一些 业务常用的函数 比如 上传 下载
  3. 打包的时候 一起把他们打包到一个js中 并支持按需导入
  4. umd格式 暴露一个全局变量 HsjaTools

一些记录

  • 推送到npm库 npm publish --access=public
  • workspace: * 发布包时候改成最新的npm版本号