@studiobear/replogger
v0.2.0
Published
Lightweight Styled Console Logging
Downloads
1
Readme
Replogger
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