Elegant Console Logger for Node.js and browser
- Easy to use
- Fancy output with fallback for minimal environments
- If the argument function returns false, console.log will not be executed
Using yarn:
yarn add razer
Using npm:
npm i razer
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')