omg-console
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

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

Package Sidebar

Install

npm i omg-console

Weekly Downloads

0

Version

1.2.2

License

MIT

Unpacked Size

17.9 kB

Total Files

9

Last publish

Collaborators

  • haozime