1.0.4 ā€¢ Published 6 years ago

cmlog v1.0.4

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

Cmlog

NPM version NPM downloads

āœļø Emoji console logger

Installation

Using yarn:

$ yarn add cmlog

Using npm:

$ npm i cmlog

Getting started

import cmlog from "cmlog"

// See types section for all available types
cmlog.debug('export something')
cmlog.warn('Something is going to happen soon')
cmlog.success('Build succeeed in 10 seconds')
cmlog.info('Some extra info is here')
cmlog.error(new Error('Foo'))

preview

Types

A list of all available default types:

  • āœ… cmlog.success(...str)
  • šŸ”µ cmlog.info(...str)
  • šŸ˜„ cmlog.warn(...str)
  • šŸ› cmlog.debug(...str)
  • āŒ› cmlog.waitting(...str)
  • šŸ”„ cmlog.boosting(...str)
  • šŸ‘¶ cmlog.start(...str)
  • āœØ cmlog.done(...str)
  • šŸ“¦ cmlog.pack(title, ...str)
  • āšŖ cmlog.module(title, ...str)
  • āŒ cmlog.error(Error)

Split / Blank

  • cmlog.split(char, count)
  • cmlog.blank(lines)
// default: char = "="; count = 40
cmlog.split()

// output:
// =========================================

// default: lines = 1;
cmlog.blank()

Log object

  • cmlog.json(obj, title)
cmlog.json("{foo:bar}","Format")

Terminal log:

āšŖ Format
  {
    foo: bar
  }

Dye string

  • cmlog.dye(color, ...str)

return: string

Colors

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • gray
  • redBright
  • greenBright
  • yellowBright
  • blueBright
  • magentaBright
  • cyanBright
  • whiteBright

Config

import { Cmlog } from "cmlog"

// default config
const cmlog = new Cmlog({
      align    : true, // whether to align info
      maxLength: 8, // (align:true) the max spacings to add
      debug    : true, // whether to show debug log
      time     : false // whether to show time info
})

License

MIT

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago