1.0.0 • Published 4 years ago

fantastic-console v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

A powerful library for beautiful console.log() output. The idea behind it to always know what and where is being console.loged. Works both in browser and Node.js console

Install

npm install fantastic-console or yarn add fantastic-console

Usage

import c from fantastic-console
...
c.cl('Login', 'onLogin', 'request', loginRequest)

Methods

methodname
.cl(component, method, variable, value)Component Log
.fl(file, method, variable, value)File Log
.ct(file, method, variable, value [,columns])Component Table
.ft(file, method, variable, value) [,columns]File Table
.ctrace(file, method, variable, value)Component Trace
.ftrace(file, method, variable, value)File Trace
.cfull(file, method, variable, value)Component Trace
.ffrace(file, method, variable, value)File Trace

Log (.cl & .fl)

Component Log and File Log. This is what you should use instead of console.log(). It is almost the same, but it gives you an exact file/ component, method and variable names

c.cl('Login', 'onLogin', 'responce', loginResponce)
c.fl('LoginService.js', 'post', 'request', loginRequest)

1

Table (.ct & .ft)

Component Table and File Table. Same as console.tabel() but with a pretty name. columns parameter allows you to set columns. Please refer to console.table() documentation

c.ct('People', 'onGetPeople', 'responce', people)
c.ft('People.js', 'onGetPeople', 'responce', people, ['firstName', 'age'])

2

Trace (.ctrace & .ftrace)

Component Trace and File Trace. Trace is collapsed by default in the browser console.

c.ctrace('People', 'onGetPeople', 'responce')
c.ftrace('People.js', 'onGetPeople', 'responce')

3

Full (.cfull & .ffull)

This methods combines the 3 previous methods, displaying data, table and trace. Please note that this method only displays trace in the browser console.

c.cfull('Login', 'post', 'request', loginRequest)
c.ffull('LoginService.js', 'post', 'request', loginRequest)

4

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago