Hacker News new | ask | show | jobs
by BinaryIdiot 3651 days ago
> Yeah, though jQuery has helped a lot to make some sort of "standard library",

jQuery is mostly a better library for dealing with the DOM though. It has support for making network calls but those don't work in node without polyfills.

> Though I guess this is what standards are for. I would like to see a browser try this anyways, though. That would be the fastest way to get the standards bodies to acknowledge the problem.

I mean fetch exists and is an HTML 5 standard that's fairly decoupled from the DOM, unlike XMLHttpRequest. But it has to also work in node.js. I wrote a set of HTTP methods in my msngr library that works in both node.js and the web browser but it feels like a hack. I want my language to have first class networking and file io.

1 comments

Did you try isomorphic-fetch?
No; node and the browser provide APIs that do this already they're just very different so I simply wrapped them to avoid dependencies (it was pretty easy). But I knew of it and it's a good idea.