razer
TypeScript icon, indicating that this package has built-in type declarations

0.3.7 • Public • Published

:bento: 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)

Readme

Keywords

Package Sidebar

Install

npm i razer

Weekly Downloads

18

Version

0.3.7

License

MIT

Unpacked Size

7.68 kB

Total Files

10

Last publish

Collaborators

  • hisasann