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

@x1a0f3n9/dsh-chunked-list

v0.1.7-rc.3

Published

Persistent append-only chunked lists with bounded copying and JSON checkpoint validation

Readme


description: "用于 projection state 的不可变的仅追加列表,提供有界追加复制、按插入顺序迭代和 Zod 检查点校验。" kind: "package-library"

@x1a0f3n9/dsh-chunked-list

English | 中文

概述

dsh-chunked-list 让调用方追加值并保留早期列表版本,无需复制整个集合。调用方可以按插入顺序迭代所有值,并使用自己的值 schema 校验 JSON 检查点。subagent 目录用它保存不可变的 projection state。

目录


使用此包

当仅追加集合需要不可变版本和兼容 JSON 的存储时,使用此列表。空列表用 undefined 表示;追加返回新的头节点,不修改已有节点。列表按引用共享所存的值,因此调用方必须将这些值视为不可变。

import { appendChunkedList, iterateChunkedList } from '@x1a0f3n9/dsh-chunked-list'

const first = appendChunkedList(undefined, 'first')
const second = appendChunkedList(first, 'second')
console.log([...iterateChunkedList(second)])

示例输出 ['first', 'second'];first 仍只包含原来的值。chunkedListSchema(valueSchema) 校验 JSON 检查点并拒绝未知字段、无效值和空分片或超大分片。当外层字段也允许空列表时,在 schema 上使用 .optional()。各操作详见源码约定。


理解实现

最新的分片最多存储 64 个值。追加最多复制该分片并共享较旧的节点,工作量为有界 O(1)。容量控制存储布局,不限制列表总长度。迭代以 O(N) 时间访问全部 N 个值,并使用 O(N / 64) 临时空间按从旧到新的顺序访问各分片。追加换片与递归 Zod 校验共用一个容量常量。

| 文件 | 职责 | |---|---| | src/index.ts | 持久化列表操作与检查点校验 | | tests/chunked-list.spec.ts | 版本隔离、顺序、结构共享与检查点接受条件 |

此库没有独立变化的观测值,因此不发布运行时不变式伴随模块;其操作返回调用方拥有的不可变值。


进一步探索


模型体验

无,因为此集合不注册任何面向模型的内容。

KV Cache 影响

本包没有内容进入模型请求,因此不影响提供方缓存复用。

已知限制与延后工作

  • 仅追加访问——需要删除或随机访问的调用方应使用其他集合。
  • 递归检查点——JSON 序列化与 schema 校验仍受运行时嵌套深度限制。所存的值本身必须支持调用方的序列化格式。

开发备注

无。