Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Latest commit

 

History

History
42 lines (30 loc) · 993 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 993 Bytes


Consistent console logging for our CLI apps.


Installation

Very simple. Just run $ npm install @gridonic/log.


How to use?

Examples say more than a thousand words.

const { info, error, success, warning } = require('@gridonic/log');

try {
    info('Starting my app…');
    
    if (specialCondition() === true) {
        warning('Please pay attention to this.');
    }
    
    // Make sure success message has enough blank space before it
    success('Everything done.', 0, 3);
} catch(myBadError) {
    error(myBadError);
}

You may also use the second (newlineAfter) and third (newlineBefore) parameter for adding newlines.

gridonic.chgridonic.github.io@gridonic