MCPcopy Create free account
hub / github.com/ZephyrCloudIO/zephyr-examples / getLogWriteStream

Function getLogWriteStream

scripts/src/utils.ts:6–13  ·  view source on GitHub ↗
(folderName: string, logFolder: string)

Source from the content-addressed store, hash-verified

4 new Date().toISOString().split(".")[0].replace(/\D/g, "");
5
6export const getLogWriteStream = (folderName: string, logFolder: string): Promise<WriteStream> => {
7 mkdirSync(logFolder, { recursive: true });
8 writeFileSync(`${logFolder}/${folderName}.txt`, "");
9 return new Promise((resolve) => {
10 const stream = createWriteStream(`${logFolder}/${folderName}.txt`);
11 stream.on("open", () => resolve(stream));
12 });
13};
14
15export const orange = (txt: string): string => `\x1b[0;33m${txt}\x1b[0m`;
16export const blue = (txt: string): string => `\x1b[1;34m${txt}\x1b[0m`;

Callers 1

buildPackagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected