1.2.2 • Published 4 years ago

omg-console v1.2.2

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

omg-console


npm.io

使用

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