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
19•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•1d 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•1d 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.

The impossible predicament of the death newts

https://crookedtimber.org/2025/06/05/occasional-paper-the-impossible-predicament-of-the-death-newts/
28•bdr•21m ago•3 comments

A proposal to restrict sites from accessing a users’ local network

https://github.com/explainers-by-googlers/local-network-access
470•doener•19h ago•264 comments

Phptop: Simple PHP ressource profiler, safe and useful for production sites

https://github.com/bearstech/phptop
45•kadrek•5h ago•5 comments

Air Lab – A portable and open air quality measuring device

https://networkedartifacts.com/airlab/simulator
185•256dpi•6h ago•87 comments

Why I wrote the BEAM book

https://happihacking.com/blog/posts/2025/why_I_wrote_theBEAMBook/
533•lawik•1d ago•135 comments

Apple Notes Will Gain Markdown Export at WWDC, and, I Have Thoughts

https://daringfireball.net/linked/2025/06/04/apple-notes-markdown
20•robenkleene•29m ago•8 comments

AtoB (YC S20) – Stripe for Transportation – is hiring engineers

https://jobs.ashbyhq.com/atob
1•vignanv8•2h ago

Show HN: I made a 3D SVG Renderer that projects textures without rasterization

https://seve.blog/p/i-made-a-3d-svg-renderer-that-projects
161•seveibar•11h ago•35 comments

OpenAI slams court order to save all ChatGPT logs, including deleted chats

https://arstechnica.com/tech-policy/2025/06/openai-says-court-forcing-it-to-save-all-chatgpt-logs-is-a-privacy-nightmare/
882•ColinWright•16h ago•694 comments

From Tokens to Thoughts: How LLMs and Humans Trade Compression for Meaning

https://arxiv.org/abs/2505.17117
27•ggirelli•6h ago•5 comments

Track Errors First

https://www.bugsink.com/blog/track-errors-first/
35•GarethX•2h ago•27 comments

Autonomous drone defeats human champions in racing first

https://www.tudelft.nl/en/2025/lr/autonomous-drone-from-tu-delft-defeats-human-champions-in-historic-racing-first
234•picture•17h ago•182 comments

LLMs and Elixir: Windfall or Deathblow?

https://www.zachdaniel.dev/p/llms-and-elixir-windfall-or-deathblow
138•uxcolumbo•15h ago•46 comments

parrot.live

https://github.com/hugomd/parrot.live
134•jasonthorsness•14h ago•31 comments

End of an Era: Landsat 7 Decommissioned After 25 Years of Earth Observation

https://www.usgs.gov/news/national-news-release/end-era-landsat-7-decommissioned-after-25-years-earth-observation
45•keepamovin•9h ago•15 comments

A Spiral Structure in the Inner Oort Cloud

https://iopscience.iop.org/article/10.3847/1538-4357/adbf9b
103•gnabgib•14h ago•25 comments

Cursor 1.0

https://www.cursor.com/en/changelog/1-0
482•ecz•17h ago•371 comments

The iPhone 15 Pro’s Depth Maps

https://tech.marksblogg.com/apple-iphone-15-pro-depth-map-heic.html
300•marklit•20h ago•79 comments

Prompt engineering playbook for programmers

https://addyo.substack.com/p/the-prompt-engineering-playbook-for
322•vinhnx•22h ago•118 comments

A new Pitt study has upended decades-old assumptions about brain plasticity

https://www.pittwire.pitt.edu/accolades-honors/2025/06/03/neuroscience-synaptic-transmission-science-advances
24•XzetaU8•8h ago•7 comments

FFmpeg merges WebRTC support

https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/167e343bbe75515a80db8ee72ffa0c607c944a00
794•Sean-Der•22h ago•175 comments

Authentication with Axum

https://mattrighetti.com/2025/05/03/authentication-with-axum
62•mattrighetti•14h ago•15 comments

Comparing Claude System Prompts Reveal Anthropic's Priorities

https://www.dbreunig.com/2025/06/03/comparing-system-prompts-across-claude-versions.html
84•dbreunig•16h ago•38 comments

Differences in link hallucination and source comprehension across different LLM

https://mikecaulfield.substack.com/p/differences-in-link-hallucination
63•hveksr•10h ago•31 comments

Tesla seeks to guard crash data from public disclosure

https://www.reuters.com/legal/government/musks-tesla-seeks-guard-crash-data-public-disclosure-2025-06-04/
390•kklisura•14h ago•275 comments

When memory was measured in kilobytes: The art of efficient vision

https://www.softwareheritage.org/2025/06/04/history_computer_vision/
116•todsacerdoti•21h ago•24 comments

IRS Direct File on GitHub

https://chrisgiven.com/2025/05/direct-file-on-github/
610•nickthegreek•21h ago•256 comments

Not all tokens are meant to be forgotten

https://arxiv.org/abs/2506.03142
41•MarcoDewey•14h ago•14 comments

A practical guide to building agents [pdf]

https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf
203•tosh•22h ago•26 comments

How we reduced the impact of zombie clients

https://letsencrypt.org/2025/06/04/how-we-reduced-the-impact-of-zombie-clients/
127•jaas•22h ago•26 comments