Files
Daniel Sogl 120e0f6d23 refactor: replace build dependencies with native Node.js APIs
Replace fs-extra/rimraf with native node:fs, lodash with
structuredClone/spread, ts-node with tsx, minimist with node:util
parseArgs, winston with console logger, async-promise-queue with
native Promise concurrency. Use promisify for child_process.exec.
Normalize all imports to use node: protocol. Extract Jest config to
jest.config.ts and replace ts-jest with @swc/jest.
2026-03-21 15:16:55 -07:00

31 lines
777 B
TypeScript

const profiles = new Map<string, number>();
export const Logger = {
error(...args: unknown[]) {
console.error('[error]', ...args);
},
info(...args: unknown[]) {
console.info('[info]', ...args);
},
verbose(...args: unknown[]) {
console.log('[verbose]', ...args);
},
debug(...args: unknown[]) {
console.debug('[debug]', ...args);
},
silly(...args: unknown[]) {
console.debug('[silly]', ...args);
},
profile(label: string) {
const now = performance.now();
const start = profiles.get(label);
if (start !== undefined) {
const durationMs = Math.round(now - start);
console.info(`[info] ${label} {"durationMs":${durationMs}}`);
profiles.delete(label);
} else {
profiles.set(label, now);
}
},
};