I was looking for modern modules that implement basic HTTP methods such as GET, POST in Node.js.
I guess the most popular is request
. The async/await version of it is called request-promise-native
.
Recently I learned that these modules are being deprecated. So, what modern alternatives can I use that are built on the async/await paradigm?
I'd strongly suggest using node-fetch. It is based on the fetch API in modern browsers. Not only is it promise-based it also has an actual standard behind it.
The only reason you wouldn't use fetch
is if you don't like the API. Then I'd suggest using something cross-platform like axios or superagent.
I personally find using the same API on the server and browser eases maintainability and offers potential for code reuse.