frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Show HN: Ultra-lightweight chunker library with emoji support

https://github.com/ushakov-igor/chonkify
18•Beardier•1d ago
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

gavmor•1d ago
No src/, only a minified index.js dist?
Beardier•1d ago
I did it primarily for my needs. But the idea is good, I'll add it today!
Beardier•1d ago
Added if you're interested :)
happytoexplain•1d ago
Cool! One thought:

>Correctly handles Unicode emoji and complex symbols

I'm no JS/TS expert, but this sounds like it could be a case of making something behave like an inexperienced dev would expect at the cost of making it behave unexpectedly to an experienced dev.

JS strings are sequences of UTF16 code points, and that's part of their public API (e.g. 'split'), right? That's JS's choice (or mistake, depending on your feelings). So I would expect 'chonk' to treat strings as what they are. And then add a flag or separate method ('chonkGraphemes') instead.

But maybe this kind of "helpfulness" is normal in 3rd party JS APIs?

Beardier•1d ago
Hi! Great idea — overall, all the edge cases are handled really well. That said, I think it would be good to add a config for the available processing options (similar to how it’s done in markdown-it, for example) to better support expected behavior. I’ll give it some thought and work on implementing it!
Beardier•1d ago
Thanks for your support! Added separate processing, now it seems the behavior is more obvious
q3k•21h ago
See, this is what I don't get about the JS/NPM ecosystem.

This is 140 lines of code, with comments. Yet it gets a whole separate repository, with a cute name, fancy README, little emoji graphics and a bespoke logo. All of this for functionality that other languages have in their stdlib.

It's almost like it's more of an exercise in marketing than an attempt to actually make a useful library.

Beardier•21h ago
Yeah, that’s just how the JS ecosystem works — even small utilities often get published as separate packages so they can be reused without copy-pasting. I originally built this for myself, and figured it might be useful to others too.

As for the name and README — I don’t really see it as marketing. I just prefer to make things clear and easy to use for anyone who stumbles across it. Even if it’s a small project, why not present it properly?

If that comes off as overkill, fair enough. I’d rather overdeliver than leave people guessing.

Picking uncontested private IP subnets with usage data

https://blog.benjojo.co.uk/post/picking-unused-rfc1918-ip-space
1•gmemstr•1m ago•0 comments

Experimenting with no-build Web Applications • AndreGarzia.com

https://andregarzia.com/2025/06/experimenting-with-no-build-web-applications.html
1•rbanffy•5m ago•0 comments

50 Years of Microsoft and Developer Tools with Scott Guthrie

https://newsletter.pragmaticengineer.com/p/50-years-of-microsoft
1•rbanffy•6m ago•0 comments

The History of R2E and the Micral

https://www.abortretry.fail/p/the-history-of-r2e-and-the-micral
1•rbanffy•6m ago•0 comments

Show HN: Loregrep – In Memory RepoMap for coding assistants

https://github.com/Vasu014/loregrep
1•vasu014•7m ago•0 comments

Red Hat just transformed enterprise server Linux

https://www.zdnet.com/article/how-red-hat-just-quietly-radically-transformed-enterprise-server-linux/
2•taubek•8m ago•0 comments

The Original 300B

https://www.westernelectric.com
1•belter•11m ago•0 comments

American Science and Surplus is fighting for its life. Why Should You Care?

https://arstechnica.com/gadgets/2025/06/american-science-surplus-is-fighting-for-its-life-heres-why-you-should-care/
1•signa11•14m ago•0 comments

Top AI Tools

1•Reviewtechs•15m ago•0 comments

A Programming System (2023)

https://andreyor.st/posts/2023-10-18-a-programming-system/
1•r4um•16m ago•0 comments

Advertising is coming to AI, and it's going to be product placement on steroids

https://sebs.website/blog/pay-per-click-advertising-is-coming-to-an-ai-near-you
1•Incerto•17m ago•0 comments

A Writers frustrating experience with ChatGPT's approach to lying

https://amandaguinzburg.substack.com/p/diabolus-ex-machina
1•wgx•17m ago•0 comments

Django, JavaScript Modules and Importmaps

https://406.ch/writing/django-javascript-modules-and-importmaps/
1•ThibWeb•17m ago•0 comments

Viralia Project

https://www.indiegogo.com/projects/viralia-next-generation-agency
1•jskkkkk•18m ago•0 comments

Tesla Optimus photoshoot with influencer Anna Malygon

https://www.coeval-magazine.com/coeval/toxic-love
2•nreece•20m ago•0 comments

The Original Permissionless JPEG: From malware payload to Bitcoin blockchain

https://theoriginalpermissionlessjpeg.com/
1•rmcdaniel•20m ago•1 comments

Detecting, Exploiting, Remediating a Path Traversal Vulnerability Across GitHub

https://arxiv.org/abs/2505.20186
1•rntn•21m ago•0 comments

Magnetic 3D-printed pen could help diagnose people with Parkinson's

https://www.theguardian.com/science/2025/jun/02/magnetic-3d-printed-pen-could-help-diagnose-people-with-parkinsons
1•bookofjoe•22m ago•0 comments

Geojob App

https://www.indiegogo.com/projects/geo-job-app
2•staceplaaaa•24m ago•1 comments

Mellon "We Are Not Alone" – A Reflection on UAP and Humanity's Cosmic Context [video]

https://www.youtube.com/watch?v=FuyVlw4EOWs
1•keepamovin•25m ago•0 comments

'I happened to be sitting next to Bill Joy at UCB when he wrote the first "yes"'

https://github.com/freebsd/freebsd-src/commit/dadfd1ed33e4ca779998ddeca7d5b0bb30098543
1•JdeBP•25m ago•1 comments

The Steve Ballmer Interview

https://open.spotify.com/episode/6SDalpojZs1dz2mLUpVMmC
1•doener•26m ago•0 comments

Building a Catalytic Computer over the Weekend

https://leetarxiv.substack.com/p/catalytic-computer
1•muragekibicho•26m ago•1 comments

An Interview with Cursor Co-Founder and CEO Michael Truell About Coding with AI

https://stratechery.com/2025/an-interview-with-cursor-co-founder-and-ceo-michael-truell-about-coding-with-ai/
2•feross•27m ago•1 comments

Open Table Format Revolution: Why Hyperscalers Are Betting on Managed Iceberg

https://www.rilldata.com/blog/the-open-table-format-revolution-why-hyperscalers-are-betting-on-managed-iceberg
2•articsputnik•27m ago•0 comments

Morley Safer Award Winners (2019)

https://morleysaferaward.briscoecenter.org/2019-morley-safer-award-winners/
1•kpli•29m ago•0 comments

Manatees as Gardeners of the Amazon

https://worldsensorium.com/manatees-as-gardeners-of-the-amazon-the-ecological-role-of-trichechus-inunguis-in-seed-dispersal-and-plant-diversity/
1•dnetesn•29m ago•0 comments

The Mathematical Mysteries of Fireflies

https://nautil.us/the-mathematical-mysteries-of-fireflies-1204513/
1•dnetesn•30m ago•0 comments

Tesla loses another manager to layoffs – but this one quit due to morale

https://electrek.co/2024/05/09/tesla-loses-another-manager-to-layoffs-but-this-one-quit-due-to-morale/
3•doener•34m ago•0 comments

Nvidia ISO-26262 Spark Process

https://nvidia.github.io/spark-process/
1•todsacerdoti•36m ago•0 comments