1.2.2 • Published 1 year ago

mycustomconsole v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

自用自定义的console

  1. 安装

    npm i mycustomconsole
  2. 使用

    //导入
    const CustomConsole = require('mycustomconsole')
    //使用
    const customConsole = new CustomConsole('====>')
    //挂载全局
    window.console = customConsole
    customConsole.log('111')
    customConsole.wain('111')
    customConsole.err('111')
    //清除log
    customConsole.clearLog
  3. 自定义

    //默认
    const header = 'hello'
    const styles = {
      version: {
        header:
          'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;',
        content:
          'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
      },
      info: {
        header: 'color: #fff; background: #606060; font-weight: bold;',
        content: 'color: green; font-weight: bold;',
      },
      log: {
        header: 'color: #fff; background: #606060; font-weight: bold;',
        content: 'color: #000000; font-weight: bold;',
      },
      warn: {
        header: 'color: #fff; background: #FFA500; font-weight: bold;',
        content: 'color: #000000; font-weight: bold;',
      },
      error: {
        header: 'color: #fff; background: #FF0000; font-weight: bold;',
        content: 'color: #000000; font-weight: bold;',
      },
    }
    const customConsole = new CustomConsole(header, styles)
    customConsole.version('version:1')
1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago