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

antd-utils

v0.1.14

Published

antd-utils

Readme

Antd Utils

功能概览

| 名称 | 方法名 | 类型 | demo | 稳定版本 | | :--: | :--: | :--: | :--: | :--: | | 表格转置 | transformTable | Table | 文档 | 0.1.5 | | 复制 tags | pasteTags | Select | 文档 | 0.1.5 | | TS 枚举转 select options | enum2Options | Select | 文档 | 0.1.5 | | 获取 url 参数 | getQueryString | Utils | 文档 | 0.1.9 | | 纵向合并相邻重复单元格 | calcRowspanToMerge | Table | 文档 | 0.1.11 |

编译

npm run compile
npm run compile:w  // 可监听

测试

npm run test

打包

npm run build

自定义打包

// 打包umd格式,兼容浏览器和node环境
npm run dev

// 打包cjs格式
npm run dev:cjs

// 打包es6格式
npm run dev:esm

发布

npm publish

Getting Started 开始使用

  1. Using npm (Recomended)

import AntdUtils from '@antd-utils';
// or
import { transformTable } from '@antd-utils';
  1. Using <script>

Direct import using <script>, use antd-utils.js or compressed version antd-utils-min.js, call window.AntdUtils.xxx

浏览器直接引入,使用 antd-utils.js 或者压缩版 antd-utils-min.js,调用 window.AntdUtils.xxx

编写工具函数

  1. 在src下创建对应函数的文件 xx(工具类,如date)/xxx.ts

  2. 在入口文件entry-compiler.ts 导入

import xxx from './xx/xxx.ts'
export = {
    ...
    xxx
}
  1. 在index.d.ts中添加类型声明, 如
declare namespace AntdUtils {
    ...
    export function xxx():void
}

编写单元测试用例

  1. 在test下创建命名为xx.spec.ts文件,然后写单元测试用例使用mocha

  2. 执行 npm run test, 可在终端查看测试通过情况和代码覆盖率

编译、打包构建、发布

// 修改提交后,直接执行以下命令,即可完成编译、打包、发布
npm run publish:patch 
npm run publish:minor
npm run publish:major
npm run publish:premajor

鸣谢

打包构建基于 @ghfengye 的 https://github.com/ghfengye/mutils

Contact

Feel free to raise issues and contact me

github: https://github.com/xunge0613 weibo: @徐迅爱上大