open-index/open-npm huggingface dataset:
npm package: @iinc/a2a
Description: Async await to Array
Author: Invertase Limited
Latest version: 0.1.0

# A2A - Async Await to Array

Simplify your promise workflow.

## Install

```bash
npm install --save @iinc/a2a
```

## Example

```js
const A2A = require('@iinc/a2a');
const axios = require('axios');

async function example1() {
  const [ error, users ] = await A2A(axios.get('https://api.com/users'));
  if (error) {
    // ... do something
  }

  console.log('Users', users);
}

async function example2() {
  const [ error, [ users, profile ] ] = await A2A([
    axios.get('https://api.com/users'),
    axios.get('https://api.com/profile'),
  ]);
  
  if (error) {
    // ... do something
  }
  
  console.log('Users', users);
  console.log('Profile', profile);
}

example1();
example2();
```