Coder Social home page Coder Social logo

cslog-ts's Introduction

cslog

Colorful & Simple React Console Logger

NPM JavaScript Style Guide

Install

npm install --save cslog

Usage

import React, { Component } from 'react'

import log from 'cslog'

const App = () => {
  log.success('Hello World') //debug messages
  log.error('Hello World')

  log.d(data, 'PersonInfo') //variable
  log.d(data)

  log.h1('Hello World') //Header tag
  log.hi('Hello JS', 'blue', 'yellow', true) //Blue text on yellow background, Broder: true

  log.p('This is a sample paragraph. it is multiline') //Paragraph tag
  log.p('I am different color text', 'white', 'purple') //White text on purple background

  log.b('I am Bold') //Bold

  log.bi('I am Bold italic') //Bold + Italic

  return <h2>Check Console</h2>
}

export default App

Color log variable values.

const lname = 'I speak Hindi & English'
const data = {
  name: 'Shivam Agrawal',
  city: 'Pipariya'
}

log.d(lname, 'Language')
log.d(data, 'PersonInfo')

Debug messages

log.success('Hello World')
log.error('Hello World')
log.info('Hello World')
log.warn('Hello World')

Simple HTML tags in console

log.h1('Hello World')
log.h2('Hello World')
log.h3('Hello World')
log.h4('Hello World')

log.p('Hello')
log.p('This is a sample paragraph. it is multiline')
log.b('I am Bold')
log.br()
log.i('I am Bold')
log.bi('I am Bold italic')

All HTML functions accepts three options parameters

  1. bg (background color)
  2. fg (foreground color)
  3. border (enable/disable border)
log.h3('I am unique styled text', 'green', 'black', true) //Green text on black background, border enabled

Chage Global Settings

log.border(true) //Enable border globally
log.setColor('red') //Set global color: red

If you like it

License

MIT © shivampip

cslog-ts's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.