1.0.7 • Published 4 years ago

ft-request-multiple-urls v1.0.7

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

ft-request-multiple-urls

npm npm npm npm

A JavaScript package that is able to
● fetch an array of URLs which contain JSON data
● return their contents in a promise

Install

Run the the below command in the terminal

npm install ft-request-multiple-urls 

Example Usage

const requestMultipleUrls = require('ft-request-multiple-urls')

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 getData = () => {
    const data = requestMultipleUrls(urls)
        .then(data => console.log(data))
        .catch(error => console.error(error))
}

getData()

Dependencies

node-fetch

node-fetch makes use of minimal code for a window.fetch compatible API on Node.js runtime. It uses native Node streams for body, on both request and response. Also, it uses native promise, but allow substituting it with insert your favorite promise library.

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago