sab-req-mul-url

1.0.28 • Public • Published

A JS package that:

  • fetches an array of URLs
  • returns their contents in a promise

Install

npm install sab-req-mul-url

Dependencies

node-fetch: A light-weight module that brings window.fetch to Node.js

Example below

const returnAllUrls = require('sab-req-mul-url');

const urls = [
'https://ft-tech-test-example.s3-eu-west-1.amazonaws.com/ftse-fsi.json', 
'https://ft-tech-test-example.s3-eu-west-1.amazonaws.com/gbp-hkd.json', 
'https://ft-tech-test-example.s3-eu-west-1.amazonaws.com/gbp-usd.json'
];

const getMultipleUrls = () => {
    const data = returnAllUrls(urls)
        .then(data => console.log(data))
        .catch(error => console.error(error))
}

Package Sidebar

Install

npm i sab-req-mul-url

Weekly Downloads

0

Version

1.0.28

License

ISC

Unpacked Size

3.63 kB

Total Files

5

Last publish

Collaborators

  • sbotchey23