1 | export class TimestampTransformer {
|
2 | transform(chunk, controller) {
|
3 | const date = new Date();
|
4 | const h = date.getHours().toString().padStart(2, "0");
|
5 | const m = date.getMinutes().toString().padStart(2, "0");
|
6 | const s = date.getSeconds().toString().padStart(2, "0");
|
7 | controller.enqueue(`[${h}:${m}:${s}]${chunk}`);
|
8 | }
|
9 | }
|