Open josephjclark opened 10 months ago
Have you noticed that all your request scripts have almost exactly the same code?
They all do this, for example:
try { const response = await fetch(url, options); const result = await response.text(); fs.writeFileSync('./data/get-code.json', result); } catch (error) { console.error(error); }
Rather than duplicating that code over so many files, can you think of a way to create a helper or library function which makes this easier?
Have you noticed that all your request scripts have almost exactly the same code?
They all do this, for example:
Rather than duplicating that code over so many files, can you think of a way to create a helper or library function which makes this easier?