Skip to content

Print colorful dots to show progress and status of asynchronously completing events

Notifications You must be signed in to change notification settings

aklt/node-dot-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Describe event state with colorful dots

Start and completion of a task will show a dot on the console. The color of the dot can be customized according to the state of the event when the task ends.

This can useful for brief reporting on async requests:

    var DotReporter = require('dot-reporter').DotReporter,
        dot = new DotReporter(/* optional state to color mappings */);

    ...

    // Start a task
    dot.taskStart('taskID');
    makeARequest(function (err, data) {

        // ... Time passes before we get to here ...

        dot.taskEnd('taskID', data.endState);
    });

The default state map is:

    {
        start: 'white',
        end:   'green',
        err:   'red',
        bad:   'purple'
    }

The initial event state must always be called start.

Run npm test to see an example.

About

Print colorful dots to show progress and status of asynchronously completing events

Resources

Stars

Watchers

Forks

Packages

No packages published