Closed puppetmaster3 closed 6 years ago
Could you try looking for an npm module?
There isn't anything special about fetch()
that it can't be written in a user module.
I do use 3rd party. My point is I should not have to. Another ex: abt() for base64. There should be more parity.
Do you mean atob()
? atob
, btoa
and fetch
aren't part of ECMAScript; but part of the WhatWG spec. I agree it would be nice to have it in, just like the WhatWG URL Implementation. Whether it's necessary in node core, I am not so sure.
Read why they turned down atob
and btoa
in node core.
@jhabdas how so?
I think there should be alternatives for the web environment following the W3C APIs to allow easy interoperatibility and reuse of code, but I don't think they should be added to the Node.js core, in fact I think this should be lighten and move things to npm (but that's another discussion). A module that export all the WhatWG APIs so you can use them directly from Node.js would be a really good thing.
I'm going to close this as the repo is being archived and there is a lack of activity.
My suggestion is to make a PR and/or issue on https://github.com/nodejs/node to discuss this. The TSC has moved towards being more open to PRs as an effort to be more welcoming. Hope it all works out!
fetch() runs in a browser. And sometimes I port my code to node. But in node, I need to 'polyfill' fetch()
That is an example where I think there should be more parity.