Getting to know a language's ecosystem is intimidating.
I am switching from backend to frontend for a while, and I think I can master typescript on my own. But when I go to https://www.npmjs.com/ where it seems like one million libraries are available, I'm like : where do I even start? π±
Dear readers, do you have a list of go-to libraries on npm that solves a specific and common problem well?
I'm not talking about big frameworks like React/Vue/Angular but things like momentjs.
On the other hand, can you think of libraries which are overused?
How do you evaluate whether you want to depend on a library and when reinventing the wheel is actually the better choice?
Top comments (10)
I did a list of personal favs a while ago π
One actually answers the question π
Looking at my recent repos, my current favs are
pnpm
better-sqlite3
cheerio
fastify
incremental-dom
- I wrote a post about this.fast-glob
; haven't triedglobby
yetmarkdown-it
and related; or sometimes,showdown
which is complete without pluginsjs-yaml
zod
orjsonschema-definer
prettier
- much simpler to set up thaneslint
, and comes with sensible defaultsid128
, for generating ULID / sortable UUIDxregexp
codemirror
highlight.js
/prism.js
reveal.js
chart.js
thanks!
before there was a feature on npm, that you can give pavkages stars like on github. I had around 70 in that list. I would hope they bring the feature back.
In my opinion grunt and gulp are useless, just to npm scripts. these task runner just transform js issues into configuration/tool problem without prividing any real value.
I often start a new frontend project, using
create-react-app
, even when not using react and just remove it. but the weback config is very good with it.For working with xml I recommens my own module txml. While also recommending json over xml.
If your main choices have already been taken care of (framework, ui lib, ...), i think you're asking the wrong question.
When you're starting to write a new feature, ask yourself:
1) Is this feature domain specific ? (yes ? then do it yourself)
2) Is there any chance that someone might already have done it ? (no ? then do it yourself)
3) Is it really worth it to use someone else code for that, or would I be happier with something I wrote ? (no ? then do it your self)
If you've passed those steps, there is a good chance that there is a lib that suits your needs.
There are literally no way to tell in advance which one will be usefull to you. Nor to know all of them. I can give you some advice to chose them, though:
That said, I know the best lib out there: mine π (shouldnt be of much use for the frontend, though)
That's super helpful, thanks a lot!
You can't go shopping without knowing what you want to buy in much the same way you can't use packages without knowing the problem. And here's how to choose the library.
I want to write a to-do list.
makes sense, thanks!
There are literally one million packages available (even more). This milestone was reached in 2019.