4 ms·
There's a module named `node-fetch` that mirrors the client Fetch API. Might make for a better solution. (but I agree it would be great for it to be built in)
by untog 9y ago
There's a module named `node-fetch` that mirrors the client Fetch API. Might make for a better solution. (but I agree it would be great for it to be built in)
- alacombe 9y agoI would not recommend `node-fetch', it's pretty crappy in term of performance if you are hitting a same host and expect some kind of keep-alive / pipelining. Switching to `make-fetch-happen' fixed all my issues.
- Can_Not 9y agoAlso if you're not intentionally looking to use a low level API, axios is much better.
- talawahdotnet 9y agoYea, built-in is what I was really going for. It would be great if new users could easily do a one-liner fetch without having to: a) Research and compare the various npm modules available and then install one (which isn't even possible via the Lambda console) or b) Figure out how to wrap an event based function in a promise (or search stack overflow and copy one) Something like this should be super easy to do from the cli/REPL or web console without dependencies. You should only have to install a module when you want more advanced features.
- ilkkao 9y agoBuiltin fetch was proposed recently, here is the issue: https://github.com/nodejs/node/issues/19393 https://github.com/nodejs/node/issues/19393