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

@nnnb/hhfast-utils

v0.1.1

Published

Core utilities for hhfast, framework agnostic.

Readme

@nnnb/hhfast-utils

中文 | English

在线地址:https://dabaoshu.github.io/hhfast/

中文

@nnnb/hhfast-utils 是 hhfast 的无框架工具与核心模块集合。它可以独立用于非 Vue 场景,也可以和 @nnnb/hhfast-ui 一起组成完整的 Playground/UI 体验。

安装

pnpm add @nnnb/hhfast-utils
# 或
npm install @nnnb/hhfast-utils

包元数据要求 Node.js >=18。

子路径入口

| 入口 | 说明 | | -------------------------------------------- | ----------------------------------------- | | @nnnb/hhfast-utils | 从 core 和 utils 汇总导出的通用能力。 | | @nnnb/hhfast-utils/background-task-manager | 后台任务管理器、调度器和持久化辅助能力。 | | @nnnb/hhfast-utils/task-execution-chain | 任务执行链、栈追踪和链路差异比较。 | | @nnnb/hhfast-utils/resumable-transfer | 面向浏览器的断点续传/上传辅助能力。 | | @nnnb/hhfast-utils/json-to-tree | 将 JSON 或业务数据转换为树节点。 | | @nnnb/hhfast-utils/curl-to-request | 将 cURL 解析为请求描述,并可序列化为 curl / fetch。 |

示例

import { AsyncQueue, retry, uuid } from "@nnnb/hhfast-utils";
import { jsonToTree } from "@nnnb/hhfast-utils/json-to-tree";

const id = uuid();
const queue = new AsyncQueue<string>({ concurrency: 2 });
const tree = jsonToTree({ id, name: "hhfast" });

const result = await retry(() =>
  queue.enqueue(async () => JSON.stringify(tree)),
);
console.log(result);

cURL 解析与序列化

import {
  parseCurlCommand,
  toCurl,
  toFetch,
} from "@nnnb/hhfast-utils/curl-to-request";

const request = parseCurlCommand("curl -X GET https://api.example.com");
const bash = toCurl(request);
const fetchCode = toFetch(request);

任务执行链

import {
  TaskExecutionChain,
  TaskExecutionStackTracer,
} from "@nnnb/hhfast-utils/task-execution-chain";

const chain = new TaskExecutionChain();
const tracer = new TaskExecutionStackTracer(chain);

后台任务管理

import { BackgroundTaskManager } from "@nnnb/hhfast-utils/background-task-manager";

const manager = new BackgroundTaskManager();

Worker 资源说明

resumable-transfer 和文件 MD5 工具会在浏览器构建中使用 worker 资源。包构建会以相对 URL 输出 worker,方便 Vite 消费方从已发布包中打包它。

Playground

交互示例位于 apps/playground,GitHub Pages 目标地址:

https://nnnb.github.io/hhfast/

本地开发:

pnpm dev
pnpm test:playground

开发与发布前检查

pnpm build:utils
pnpm typecheck:utils
pnpm test:utils

发布前在仓库根目录运行完整检查:

pnpm release:check

English

@nnnb/hhfast-utils provides framework-agnostic utilities and core modules for hhfast. Use it without Vue, or pair it with @nnnb/hhfast-ui when building the full Playground/UI experience.

Install

pnpm add @nnnb/hhfast-utils
# or
npm install @nnnb/hhfast-utils

Node.js >=18 is required by the package metadata.

Entry Points

| Entry point | Description | | -------------------------------------------- | ------------------------------------------------------------- | | @nnnb/hhfast-utils | Shared utilities exported from core and utils. | | @nnnb/hhfast-utils/background-task-manager | Background task manager, scheduler and persistence helpers. | | @nnnb/hhfast-utils/task-execution-chain | Task execution chain, stack tracing and chain diff utilities. | | @nnnb/hhfast-utils/resumable-transfer | Browser-oriented resumable upload/transfer helpers. | | @nnnb/hhfast-utils/json-to-tree | Convert JSON/business data into tree nodes. | | @nnnb/hhfast-utils/curl-to-request | Parse cURL into request descriptions; serialize to curl / fetch. |

Examples

import { AsyncQueue, retry, uuid } from "@nnnb/hhfast-utils";
import { jsonToTree } from "@nnnb/hhfast-utils/json-to-tree";

const id = uuid();
const queue = new AsyncQueue<string>({ concurrency: 2 });
const tree = jsonToTree({ id, name: "hhfast" });

const result = await retry(() =>
  queue.enqueue(async () => JSON.stringify(tree)),
);
console.log(result);

cURL Parse And Serialize

import {
  parseCurlCommand,
  toCurl,
  toFetch,
} from "@nnnb/hhfast-utils/curl-to-request";

const request = parseCurlCommand("curl -X GET https://api.example.com");
const bash = toCurl(request);
const fetchCode = toFetch(request);

Task Execution Chain

import {
  TaskExecutionChain,
  TaskExecutionStackTracer,
} from "@nnnb/hhfast-utils/task-execution-chain";

const chain = new TaskExecutionChain();
const tracer = new TaskExecutionStackTracer(chain);

Background Task Manager

import { BackgroundTaskManager } from "@nnnb/hhfast-utils/background-task-manager";

const manager = new BackgroundTaskManager();

Worker Asset Note

resumable-transfer and file MD5 helpers use a worker asset in browser builds. The package build emits the worker with a relative URL so Vite consumers can bundle it from the published package.

Playground

The interactive demos for these utilities live in apps/playground and are intended for GitHub Pages at:

https://nnnb.github.io/hhfast/

Local development:

pnpm dev
pnpm test:playground

Development And Release Check

pnpm build:utils
pnpm typecheck:utils
pnpm test:utils

Before publishing, run the workspace release gate from the repository root:

pnpm release:check

License

MIT