DEV Community

Cover image for Request for Node.js has been deprecated

Request for Node.js has been deprecated

Corentin on February 19, 2020

The breaking news landed a few days ago, with a simple commit entitled "doc: note full deprecation". That's right! request, one of the top and old...
Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Why not standard library anyways?

I really hate to see this error message in node-sqlite3. Why does need request, anyway?

Collapse
 
maple3142 profile image
maple

You can use that if you want, but it is a little bit verbose to write compared to other libraries, which most developers don't like.

Collapse
 
frenchcooc profile image
Corentin Mailmeteor

I kind of prefer the core HTTP module as well. It helps to really understand how it works in depth. But it's also pretty verbose compared to most frameworks/lib.

Collapse
 
aerabi profile image
Mohammad-Ali A'RΓ‚BI

As I have mentioned in this StackOverflow answer, the reason for deprecation is both the interface and the underlying code.

Callbacks are very hard to deal with. This is why we have promisify and bindCallback for promises and observables, respectively. But, as request is a many-faced god, it's hard to get rid of its callback interface.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

I prefer a node fetch implementation in case I had a view for isomorphism, there is one less thing to change.

Collapse
 
tracker1 profile image
Michael J. Ryan

For pretty much everything I'm working on now, I cut off with fetch and async function support (around April 2017 and newer browsers). In node, I use node-fetch or setup a global if I'm sharing code libraries.

While fetch isn't perfect, usually create an api wrapper around it. It's standard, cleaner than alternatives and built into the browsers (smaller bundles).

Collapse
 
frenchcooc profile image
Corentin Mailmeteor

That's exactly why @mikeal the creator of request deprecated the project

Collapse
 
frenchcooc profile image
Corentin Mailmeteor

Yeah! fetch is easy to use and pretty well supported now.