1.0.1 • Published 7 years ago

conditional-console v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

ConditionalConsole

This allows for chained conditions, before outputting to console.log(). And (the important part) it supports showing the correct line, from where the log is called.

Installation

npm install conditional-console

Or include the ConditionalConsole.min.js file in..

<script src="ConditionalConsole.min.js"></script>

Usage

This simple example gives the general idea.

cci.check(1 === 1).log('This is logged');
cci.check(1 !== 1).check(1 === 2).log('And this is not')

There's also an build in reporting system.

cci.setReporting('all -verbose')
cci.type('verbose').log('Not shown.');
cci.type('error').log('Shown.');
cci.type('error').check(false).log('Not shown, because of the check.');