# fetch-multiple

> A utility function to help you fetch multiple different resources in one promise

Latest version **1.2.3** (published 2018-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install fetch-multiple
pnpm add fetch-multiple
yarn add fetch-multiple
bun add fetch-multiple
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2018-02-23 |
| First published | 2018-01-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sean Crater |
| Maintainers | seancrater |
| Keywords | javascript, fetch, promise, multiple, requests, multi |

## Links

- npm: https://www.npmjs.com/package/fetch-multiple
- Repository: https://github.com/seancrater/fetch-multiple
- Homepage: https://github.com/seancrater/fetch-multiple#readme
- Issues: https://github.com/seancrater/fetch-multiple/issues
- npm.io page: https://npm.io/package/fetch-multiple

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.2.3 (latest) — 2018-02-23
- 1.2.2 — 2018-01-27
- 1.2.1 — 2018-01-27
- 1.2.0 — 2018-01-27
- 1.1.2 — 2018-01-27
- 1.1.1 — 2018-01-27
- 1.1.0 — 2018-01-27
- 1.0.1 — 2018-01-27
- 1.0.0 — 2018-01-27

## README

# fetch-multiple

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

*Here are some basic instructions to get up and running*

```shell
$ npm install fetch-multiple --save-dev
```

```javascript
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.**

---
_Source: https://npm.io/package/fetch-multiple · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
