mg 1 day ago

Beautiful.

Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well.

I wish there was a way to search for libraries like this one. Almost every time I look for some piece of open source software, I end up writing it myself because all the solutions I find are overcomplicated and try to do too many things.

3
h1fra 1 day ago

Except this file does almost nothing compared to the actual website. The website is worth 1Mb of dependencies

chipdart 1 day ago

> Single file, 187 lines of JavaScript, no dependencies, does one thing and does it well.

Even though I understood your point, a cursory glance suggests it only maps a JavaScript object to a SVG. Hardly something with more than one responsibility, or something you need anything other than plain JavaScript to do.

mg 1 day ago

That is what I mean with "does one thing". The author made the right choice to put just one feature into this repo.

If you publish a repo with many features, bells and whistles, it is lost on me.

If you publish a repo that aims to do one thing in the best way possible, I will take a look at it, might use it, might contribute if I stumble across something that can be improved.

Repos like this should stay as small and focussed as they are. New features should go into new repos that make use of repos like this one.

aminemat 1 day ago

You clearly don’t know how much js devs love dependencies! Look up “left-pad incident”

chipdart 1 day ago

I do. I know that colors.js is a meme by now.

deskr 1 day ago

My thoughts exactly. I was expecting the classic millions of dependencies. Very nice!