const unprint = require('unprint'); async function tryUrls(urls, options) { return urls.filter(Boolean).reduce(async (chain, url) => { const acc = await chain; if (acc?.res.ok) { return acc; } const res = await unprint.get(url, options); return { res, url, }; }, Promise.resolve()); } module.exports = tryUrls;