UNPKG

@augment-vir/common

Version:

A collection of augments, helpers types, functions, and classes for any JavaScript environment.

20 lines (19 loc) 537 B
import { wait } from '@augment-vir/core'; import { log } from './log.js'; /** * Logs each second as a countdown, then resolves. * * @category Log * @category Package : @augment-vir/common * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common) */ export async function logCountdown(start, logCallback = log.warning) { logCallback(String(start)); await wait({ seconds: 1.5 }); if (start) { return await logCountdown(start - 1, logCallback); } else { return; } }