1.2.3 • Published 6 years ago

fetch-multiple v1.2.3

Weekly downloads
1,251
License
ISC
Repository
github
Last release
6 years ago

fetch-multiple

A tiny library created for fetching multiple assets in one promise.

Here are some basic instructions to get up and running

$ npm install fetch-multiple --save-dev
import fetchMultiple from 'fetch-multiple';

const fetchables = {
  '/data.json': 'json',
  '/text.txt': 'text'
};

fetchMultiple(fetchables)
  .then(data => {
    console.log(data);
  });

  // This function logs:
  // {
  //   '/data.json': { jsonResponse },
  //   '/text.txt': 'textResponse'
  // }

The only argument that the function requires is an object of URLs as keys and values of the desired parsing method.

Available parsing methods are based on what the fetch protocol is capable of:

- arrayBuffer
- blob
- formData
- json
- text

Please note that this library's data structure may change as new features are added in newer releases.

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago