UNPKG

axax

Version:

A library of async iterator extensions for JavaScript including ```map```, ```reduce```, ```filter```, ```flatMap```, ```pipe``` and [more](https://github.com/jamiemccrindle/axax/blob/master/docs/API.md#functions).

14 lines (13 loc) 291 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Count the number of items in an async interable */ async function count(source) { let total = 0; for await (const item of source) { total++; } return total; } exports.count = count;