Files
BewlyBewly/scripts/utils.ts
Stephen Zhou 736f8d7eaf chore: update deps (#661)
Co-authored-by: Hakadao <a578457889743@gmail.com>
2024-04-25 16:21:19 +08:00

15 lines
607 B
TypeScript

import { dirname, resolve } from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import { bgCyan, black } from 'kolorist'
export const port = Number.parseInt(process.env.PORT || '') || 3303
export const r = (...args: string[]) => resolve(dirname(fileURLToPath(import.meta.url)), '..', ...args)
export const isDev = process.env.NODE_ENV !== 'production'
export const isWin = process.platform === 'win32'
export const isFirefox = process.env.FIREFOX === 'true'
export function log(name: string, message: string) {
console.log(black(bgCyan(` ${name} `)), message)
}