Skip to content

Repository files navigation

omg-console


使用

npm install omg-console -save
import Console from 'omg-console'
const console = new Console('my namespace')
console.log('hello world')

Options

new Console('my namespace')
new Console({name: 'xxx', verbose: true})

单例模式

import { console } from 'omg-console'
console.log('xxx') // singleton

import { rawConsole } from 'omg-console'
rawConsole // original global.console

全局调试

# 全局环境变量
export OMG_CONSOLE_VERBOSE=true

特性

  • 全功能的 console 替代方案,支持所有原生 console 方法
  • 常用方法颜色高亮
  • 错误会走到 stderr 流
  • 支持回溯到源码对应行
  • 支持 sourcemap

About

A better console.log for terminal

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages