MCPcopy
hub / github.com/bombshell-dev/clack / main

Function main

examples/basic/stream.ts:5–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import color from 'picocolors';
4
5async function main() {
6 console.clear();
7
8 await setTimeout(1000);
9
10 p.intro(`${color.bgCyan(color.black(' create-app '))}`);
11
12 await p.stream.step(
13 (async function* () {
14 for (const line of lorem) {
15 for (const word of line.split(' ')) {
16 yield word;
17 yield ' ';
18 await setTimeout(200);
19 }
20 yield '\n';
21 if (line !== lorem.at(-1)) {
22 await setTimeout(1000);
23 }
24 }
25 })()
26 );
27
28 p.outro(`Problems? ${color.underline(color.cyan('https://example.com/issues'))}`);
29}
30
31const lorem = [
32 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',

Callers 1

stream.tsFile · 0.70

Calls 1

clearMethod · 0.65

Tested by

no test coverage detected