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
Accedi per aggiungere un commento
Altri post in questo gruppo

Article URL: https://www.joindns4.eu/for-public
Comments URL: https://news.ycombinat
Article URL: https://tably.com/tably/10-years-of-betting-on-rust


Article URL: https://www.bugsink.com/blog/track-errors-first/

Article URL: https://jobs.ashbyhq.com/atob
Comments URL: https://news.ycombinator.com/ite

Article URL: https://networkedartifacts.com/airlab/simulator