node-fetch-multiple-urls
v1.0.0
Published
node utility to fetch multiple urls and combine json result
Downloads
4
Readme
node-fetch-multiple-urls
Node JS module to fetch multiple urls and return response as promise object.
Installation
npm install node-fetch-multiple-urls
Run tests
npm test
Usage
import { fetchMultipleUrls } from './index.js';
const urls = [
'https://pokeapi.co/api/v2/pokemon?limit=4&offset=0',
'https://pokeapi.co/api/v2/pokemon/1',
];
fetchMultipleUrls(urls)
.then(content => console.log(`Content => ${JSON.stringify(content)}`))
.catch(err => console.log(`Error while requesting multiple urls: ${err.message}`));
Dependencies
node-fetch