🧩 Returns the total count of items in an async iterable.
Syntax
TypeScript
import { countIterAsync } from '@opentf/std'; countIterAsync(iter: AsyncIterable<unknown>): Promise<number>
Parameters
iter: The async iterable to count.
Returns
A promise that resolves to the total count of items.
Examples
TypeScript
async function* gen() { yield 1; yield 2; } await countIterAsync(gen()) //=> 2