twitchdev / authentication-node-sample

Apache License 2.0
105 stars 49 forks source link

Recommend removing the deprecated "request" package in favor of "node-fetch" #1

Open bennyfits opened 4 years ago

bennyfits commented 4 years ago

As of February the package "request" has been deprecated and will no longer be supported.

I would recommend switching to "node-fetch" which is more likely to be maintained and is, ultimately, a cleaner method for making the request.

const fetch = require('node-fetch');

fetch('https://api.twitch.tv/helix/users', options)
    .then( response => response.json())
    .then( data => {
        // magic happens with the parsed response JSON 
        done(); 
    });

It may seem a little silly to create an issue on something intended to be a sample but deprecated packages are not returned in search results on npmjs.com which could make searching for documentation difficult for those adapting the sample.

marcobrunodev commented 3 years ago

Very nice!