News for hackers. Stuff that matters.
Re:ECMAScript 2016 Approved by BinaryIdiot on Friday June 17, 2016 @12:53AM (#11920752)
> 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.

Re:ECMAScript 2016 Approved by aviraldg on Friday June 17, 2016 @03:05AM (#11921085)
Did you try isomorphic-fetch?
Re:ECMAScript 2016 Approved by BinaryIdiot on Friday June 17, 2016 @09:03AM (#11922364)
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.