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

memchunk

v0.4.0

Published

The fastest semantic text chunking library

Readme


you know how every chunking library claims to be fast? yeah, we actually meant it.

memchunk splits text at semantic boundaries (periods, newlines, the usual suspects) and does it stupid fast. we're talking "chunk the entire english wikipedia in 120ms" fast.

want to know how? read the blog post where we nerd out about SIMD instructions and lookup tables.

📦 installation

npm install memchunk

looking for rust or python?

🚀 usage

import { init, chunk } from 'memchunk';

// initialize wasm (required once)
await init();

const text = "Hello world. How are you? I'm fine.\nThanks for asking.";

// with defaults (4KB chunks, split at \n . ?)
for (const slice of chunk(text)) {
    console.log(slice);
}

// with custom size
for (const slice of chunk(text, { size: 1024 })) {
    console.log(slice);
}

// with custom delimiters
for (const slice of chunk(text, { delimiters: ".?!\n" })) {
    console.log(slice);
}

// with multi-byte pattern (e.g., metaspace ▁ for SentencePiece tokenizers)
for (const slice of chunk(text, { pattern: "▁", prefix: true })) {
    console.log(slice);
}

// with consecutive pattern handling (split at START of runs, not middle)
for (const slice of chunk("word   next", { pattern: " ", consecutive: true })) {
    console.log(slice);
}

// with forward fallback (search forward if no pattern in backward window)
for (const slice of chunk(text, { pattern: " ", forwardFallback: true })) {
    console.log(slice);
}

// collect all chunks
const chunks = [...chunk(text)];

pass strings and get strings back. for zero-copy performance with binary data, pass Uint8Array and you'll get Uint8Array views back.

📝 citation

if you use memchunk in your research, please cite it as follows:

@software{memchunk2025,
  author = {Minhas, Bhavnick},
  title = {memchunk: The fastest text chunking library},
  year = {2025},
  publisher = {GitHub},
  howpublished = {\url{https://github.com/chonkie-inc/memchunk}},
}

📄 license

licensed under either of Apache License, Version 2.0 or MIT license at your option.