first commit

This commit is contained in:
2026-10-03 23:43:38 +04:00
commit 3a8045a141
40 changed files with 6262 additions and 0 deletions

18
src/util/logger.js Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
function createLogger({ verbose = false } = {}) {
const write = (stream, prefix, args) => {
stream.write(prefix + args.map(String).join(' ') + '\n');
};
return {
info: (...args) => write(process.stdout, '', args),
warn: (...args) => write(process.stderr, 'warning: ', args),
error: (...args) => write(process.stderr, 'error: ', args),
debug: (...args) => {
if (verbose) write(process.stdout, 'debug: ', args);
},
verbose,
};
}
module.exports = { createLogger };