mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-04-29 03:57:20 +09:00
12 lines
353 B
TypeScript
12 lines
353 B
TypeScript
import * as chalk from 'chalk';
|
|
|
|
export default function(msg: string) {
|
|
const now = new Date();
|
|
const date = `${zeroPad(now.getHours())}:${zeroPad(now.getMinutes())}:${zeroPad(now.getSeconds())}`;
|
|
console.log(`${chalk.gray(date)} ${msg}`);
|
|
}
|
|
|
|
function zeroPad(num: number, length: number = 2): string {
|
|
return ('0000000000' + num).slice(-length);
|
|
}
|