リファクタリングなど

This commit is contained in:
syuilo
2019-01-16 02:10:42 +09:00
parent c32c871d4d
commit 09fc4291f0
5 changed files with 29 additions and 25 deletions

View File

@ -1,7 +1,9 @@
import 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(`${date} ${msg}`);
console.log(`${chalk.gray(date)} ${msg}`);
}
function zeroPad(num: number, length: number = 2): string {