Config files for my server. Except not my secrets
1/**
2 * Delays the output of each character in the input stream by 10ms
3 * @returns TransformStream
4 */
5export const stagger = () =>
6 new TransformStream({
7 async transform(
8 chunk: string,
9 controller: TransformStreamDefaultController<string>
10 ) {
11 for (const part of chunk) {
12 controller.enqueue(part);
13 await new Promise((res) => setTimeout(res, 10));
14 }
15 },
16 });