Skip to content

lemon-sour/razer

Repository files navigation

🍱 razer

Elegant Console Logger for Node.js and browser

Downloads Version License PRs Welcome

Why razer?

  • Easy to use
  • Fancy output with fallback for minimal environments
  • If the argument function returns false, console.log will not be executed

Installation

Using yarn:

yarn add razer

Using npm:

npm i razer

Getting Started

Basic usage:

import razer from 'razer'

razer('Hello Razer!')

How to use for production:

import razer from 'razer'

process.env.NODE_ENV = 'production'
const logger = razer(() => {
  process.env.NODE_ENV !== 'production'   // false
})

logger('Razer as console.log will not be executed')

Other using:

import razer from 'razer'

process.env.NODE_ENV = 'development'
const logger = razer(() => {
  process.env.NODE_ENV !== 'production'   // true
})

logger('Razer as console.log will be executed')

Author

License

MIT © hisasann (Yoshiyuki Hisamatsu)