tn-consoler

Stylish console for browsers

Usage no npm install needed!

<script type="module">
  import tnConsoler from 'https://cdn.skypack.dev/tn-consoler';
</script>

README

Bundle Size - 2.02 Kb gzipped

Usage

import { consoler } from 'tn-consoler'
consoler.log(`Wow {bgcyan+b:text}`, options, ...others)

Methods

  • consoler.log()
  • consoler.warn()
  • consoler.error()
  • consoler.trace()
  • consoler.group()
  • consoler.groupCollapsed()
  • consoler.groupEnd()

Syntax

;`{tag:text}``{tag+tag+tag:text}``{tag:with \\{\\:\\} scapes}`

Tags

  • Colors : dark, light, red, cyan, green, white, orange, purple, yellow, grey
  • Background Colors : bgdark, bglight, bgred, bgcyan, bggreen, bgwhite, bgorange, bgpurple, bgyellow, bggrey
  • Others : b, nb, i, ni, u, nu

Options

const options = {
  $global: ['tag', 'tag', { fontSize: '25px' }],
  custom: { fontWeight: 'bold' },
  custom2: ['bgred', 'b', {...}]
}