I kept rewriting the same array.slice(i, i + n) logic in every project. Eventually, I decided to stop and just make a utility.
Chonkify is a small (~870B), zero-dependency JS/TS library for chunking any kind of data:
- Works with Array, String, Buffer, Set, Map, Array-like, TypedArray
- Handles AsyncIterable (great for batching streams)
- Unicode-safe (correctly handles grapheme clusters, emoji, etc.)
- ESM-first, TypeScript-ready
I mostly made it for myself, but figured others might find it useful too.
Would love feedback!
Comments URL: https://news.ycombinator.com/item?id=44172017
Points: 12
# Comments: 2
Autentifică-te pentru a adăuga comentarii
Alte posturi din acest grup

My friend and I got tired of job hunting (347 applications, 4 responses) so we built AI agents to help job seekers instead of replacing them.
The problem: 73% of applications never reach humans,

Article URL: https://luxeengine.com/
Comments URL: https://news.ycombinator.com/item?id=4426927
Article URL: https://www.nhatcher.com/post/on-hats-and-sats/



Article URL: https://arxiv.org/abs/2502.13293
Comments URL: https://news.ycombinator.c