authentication-node-sample icon indicating copy to clipboard operation
authentication-node-sample copied to clipboard

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

Open bennyfits opened this issue 5 years ago • 1 comments

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.

bennyfits avatar Apr 06 '20 04:04 bennyfits

Very nice!

marcobrunodev avatar Sep 24 '20 21:09 marcobrunodev