codehost

Generate syntax highlighted code blocks for cohost. Please submit feature requests and bug reports on GitHub. See what's new in the changelog.
Preview @cohost

Your post title

// 3... 2... 1... Blast-off!
async function countdown(): Promise<void> {
  for (let i = 10; i > 0; i--) {
    console.log(i);
    await sleep(1000);
  }
  console.log("Blast-off!");
}

/**
 * `setTimeout` for `delay` miliseconds
 */
async function sleep(delay: number): Promise<void> {
  return new Promise((resolve) => {
    setTimeout(resolve, delay);
  });
}

countdown();
syntax highlighting by codehost