conditional-console

1.0.1 • Public • Published

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.');

/conditional-console/

    Package Sidebar

    Install

    npm i conditional-console

    Weekly Downloads

    7

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • philipbirk