Skip to content

Studiobear/replogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Lightweight Styled Console Logging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published