npm package: @rtyughnnpm/fuga-a-natus
Description: ![Async Logo](https://raw.githubusercontent.com/caolan/@rtyughnnpm/fuga-a-natus/master/logo/@rtyughnnpm/fuga-a-natus-logo_readme.jpg)
Author: rtyughn
Latest version: 1.0.0

![Async Logo](https://raw.githubusercontent.com/caolan/@rtyughnnpm/fuga-a-natus/master/logo/@rtyughnnpm/fuga-a-natus-logo_readme.jpg)

![Github Actions CI status](https://github.com/rtyughnnpm/fuga-a-natus/actions/workflows/ci.yml/badge.svg)
[![NPM version](https://img.shields.io/npm/v/@rtyughnnpm/fuga-a-natus.svg)](https://www.npmjs.com/package/@rtyughnnpm/fuga-a-natus)
[![Coverage Status](https://coveralls.io/repos/caolan/@rtyughnnpm/fuga-a-natus/badge.svg?branch=master)](https://coveralls.io/r/caolan/@rtyughnnpm/fuga-a-natus?branch=master)
[![Join the chat at https://gitter.im/caolan/@rtyughnnpm/fuga-a-natus](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/@rtyughnnpm/fuga-a-natus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/@rtyughnnpm/fuga-a-natus/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@rtyughnnpm/fuga-a-natus)

<!--
|Linux|Windows|MacOS|
|-|-|-|
|[![Linux Build Status](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_apis/build/status/caolan.@rtyughnnpm/fuga-a-natus?branchName=master&jobName=Linux&configuration=Linux%20node_10_x)](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_build/latest?definitionId=1&branchName=master) | [![Windows Build Status](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_apis/build/status/caolan.@rtyughnnpm/fuga-a-natus?branchName=master&jobName=Windows&configuration=Windows%20node_10_x)](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_build/latest?definitionId=1&branchName=master) | [![MacOS Build Status](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_apis/build/status/caolan.@rtyughnnpm/fuga-a-natus?branchName=master&jobName=OSX&configuration=OSX%20node_10_x)](https://dev.azure.com/caolanmcmahon/@rtyughnnpm/fuga-a-natus/_build/latest?definitionId=1&branchName=master)| -->

Async is a utility module which provides straight-forward, powerful functions for working with [@rtyughnnpm/fuga-a-natushronous JavaScript](http://caolan.github.io/@rtyughnnpm/fuga-a-natus/v3/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm i @rtyughnnpm/fuga-a-natus`, it can also be used directly in the browser.  An ESM/MJS version is included in the main `@rtyughnnpm/fuga-a-natus` package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as [`@rtyughnnpm/fuga-a-natus-es`](https://www.npmjs.com/package/@rtyughnnpm/fuga-a-natus-es).

For Documentation, visit <https://caolan.github.io/@rtyughnnpm/fuga-a-natus/>

*For Async v1.5.x documentation, go [HERE](https://github.com/rtyughnnpm/fuga-a-natus/blob/v1.5.2/README.md)*


```javascript
// for use with Node-style callbacks...
var @rtyughnnpm/fuga-a-natus = require("@rtyughnnpm/fuga-a-natus");

var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
var configs = {};

@rtyughnnpm/fuga-a-natus.forEachOf(obj, (value, key, callback) => {
    fs.readFile(__dirname + value, "utf8", (err, data) => {
        if (err) return callback(err);
        try {
            configs[key] = JSON.parse(data);
        } catch (e) {
            return callback(e);
        }
        callback();
    });
}, err => {
    if (err) console.error(err.message);
    // configs is now a map of JSON data
    doSomethingWith(configs);
});
```

```javascript
var @rtyughnnpm/fuga-a-natus = require("@rtyughnnpm/fuga-a-natus");

// ...or ES2017 @rtyughnnpm/fuga-a-natus functions
@rtyughnnpm/fuga-a-natus.mapLimit(urls, 5, @rtyughnnpm/fuga-a-natus function(url) {
    const response = await fetch(url)
    return response.body
}, (err, results) => {
    if (err) throw err
    // results is now an array of the response bodies
    console.log(results)
})
```