Tuesday 22 October 2019

Wrapping my head around Async/Await with node-fetch / axios

TL;DR Every tutorial just has "console.log(res.json())" - not helpful. Has anyone "chained" fetch or axios? The tool I'm writing will be open source but I want to get a head start on it before I'm supposed to be working on it, so I can't really share my code.The github API will list all of my Repos just fine. I can based on that list filter it and return it to only include repos authored by me. I can pass that list into a function to fetch a second request => *the contents of each repo*. Now I'm stuck. From the contents JSON, I need to "store" in memory a list of "files" and a list of "directories", then do operations on the files, and repeat the listing of directories with another fetch, just once more (not recursively beyond that), and do operations on the files in the second level directories.Any help would be greatly appreciated, if there's a request maybe I'll post a 24 hour pastebin.

Submitted October 22, 2019 at 07:46PM by dmattox10

No comments:

Post a Comment