0.2.0 • Published 3 years ago

@studiobear/replogger v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Replogger

GitHub license npm bundle size GitHub package.json version

This is a lightweight wrapper for console.log allowing simple console styling. Generally, one would use a full-feature log styler like chalk, however, some termninals don't support it.

Instead, we'll use ANSI escape code to wrap our log statements in simple color and style forms.

Inspired by the desire for easier-to-read console statements using repl.it

Getting Started

Intended for use as an ES module. Insert directly into an HTML file:

<script type="module">
      import replogger from 'https://cdn.skypack.dev/@studiobear/replogger'
      const l = replogger();
      l.info('Hello, I should be green');
</script>

Usage

Coming soon...

  • log: plain ole console
  • info: green
  • note: cyan
  • warn: yellow
  • error: red
  • hl: yellow background
  • wrap: apply color to string
  • getDefaults: view defaults
  • setDefaults: set defaults
  • styles: use style snippets
  • colors: use color snippets
  • bgs: use background snippets
  • util: use util snippets
0.2.0

3 years ago

0.1.0

3 years ago