logoalt Hacker News

miroljubyesterday at 11:29 PM3 repliesview on HN

The issue with npm is JS doesn't have a stdlib, so developers need to rely on npm and third party libs even for things stdlib provide in languages like Java, Python, Go, ...


Replies

josephgyesterday at 11:37 PM

Sure it does. The JS standard library these days is huge. Its way bigger than C, Zig and Rust. It includes:

- Random numbers

- Timezones, date formatting

- JSON parsing & serialization

- Functional programming tools (map, filter, reduce, Object.fromEntries, etc)

- TypedArrays

And if you use bun or nodejs, you also have out of the box access to an HTTP server, filesystem APIs, gzip, TLS and more. And if you're working in a browser, almost everything in jquery has since been pulled into the browser too. Eg, document.querySelector.

Of course, web frameworks like react aren't part of the standard library in JS. Nor should they be.

What more do you want JS to include by default? What do java, python and go have in their standard libraries that JS is missing?

show 1 reply
Eduardyesterday at 11:48 PM

JS has a stdlib, so to say. See nodejs, and Web standard.

And no programming language's stdlib includes e. g. WhatsApp API libraries