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

@antv/util

v3.3.11

Published

<h1 align="center">@antv/util</h1>

Readme

AntV 底层依赖的工具库,包含有所有的 util 纯函数,不建议在自己业务中使用,避免因为迭代过程的 Break Change 给您带来维护成本。

Build Status npm Version npm Download npm License

✨ 特性

  • 轻量级:按需实现代码逻辑,尽可能的减少包大小,目前约 12kb;在 lodash 未优化包大小之前,不要在 AntV 中使用 lodash。
  • 工具丰富:包含了不同类别的函数上百种。
  • 可视化:特化工具可视化中使用的颜色、形状、路径、向量、矩阵等方向的功能。

📦 安装

$ npm install @antv/util

🔨 上手

import { path2String, path2Array } from '@antv/util';

path2String([
  ['M', 10, 10],
  ['L', 100, 100],
  ['l', 10, 10],
  ['h', 20],
  ['v', 20],
]); 
// ----> 'M10 10L100 100l10 10h20v20'

path2Array('M10 10L100 100l10 10h20v20');
/**
 *  ------->
 * [
 *  ['M', 10, 10],
 *  ['L', 100, 100],
 *  ['l', 10, 10],
 *  ['h', 20],
 *  ['v', 20],
 * ]
 */

📎 API

🚥 原则

  • util 只有一个 npm 包,按照目录来组织不同类型的方法,避免 monorepo 互相依赖。
  • 内容和 AntV 强相关,避免做和 lodash 等相同的工具库。
  • 不使用的方法,及时删除,并保持新增方法可以按需引入。
  • 保持单元测试、文档的完整性。
  • 旧版本不维护,如果 AntV 技术栈的旧版本需要迭代,请升级到 v3。

📮 贡献

$ git clone [email protected]:antvis/util.git

$ cd util

$ npm i

$ npm t

写完代码之后,提交 PR 即可。

License

MIT@AntV.