razer
v0.3.7
Published
Elegant Console Logger for Node.js and browser
Downloads
64
Readme
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')