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

tz-lts

v0.1.0

Published

Analyze potential long tasks and generate patch to split heavy sync work into async chunks.

Readme

longtask-split (MVP)

独立 CLI:分析潜在长任务热点,并生成 patch(默认不写回文件)把同步重计算改造成可 await 的异步切片版本(Promise 化)。

安装与构建

cd tools/longtask-split
npm i
npm run build

本地运行(构建后):

node dist/index.js --help

命令

1) Analyze

node dist/index.js analyze <repoRoot> --file <path> --symbol <name>

输出:

  • longtask-report.json
  • longtask-report.md

2) Transform (Patch only)

node dist/index.js transform <repoRoot> --file <path> --symbol <name> --patch longtask-split.patch

可选注入 runtime(在 patch 里新增 TaskSplitter/yieldToMain 文件):

node dist/index.js transform <repoRoot> --file <path> --symbol <name> \
  --inject-runtime \
  --runtime-path src/utils/task-splitter.ts \
  --patch longtask-split.patch

行为边界(重要)

  • 默认只新增 xxxAsync(Promise 化)并在其内部对第一处 for (...) 插入 await yieldToMain('idle') 作为示例切片点。
  • 会尝试自动改造调用点(安全子集):
    • async function 内:foo()await fooAsync()
    • useEffect(() => { ... })无 cleanup return:把整个 effect body 包进 async IIFE 再执行
  • 不会改造 render/useMemo/useCallback 同步路径;会在 report 里提示原因。
  • 不能中断“单个 task”;如果单次循环体本身很重,仍需要进一步拆小工作单元。