0.0.10 • Published 5 years ago

@skazska/inform v0.0.10

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

Build Status

inform

Provide a tool to prepare and print-out information on tasks progress

npm run demo - to see a demo

usage:

const Inform = require('@skazska/inform');
const inform = new Inform('main');
const group = inform.mainGroup;
const informer = group.addInformer(new Promise((resolve, reject ) => setTimeout(() => {reject(new Error('done'))}, 100)), {
    failText: 'damn',
    pendingText: 'waiting',
    inProcessText: 'doing',
    doneText: 'did',
    text: 'it'
});

const promise1 = new Promise((resolve, reject ) => setTimeout(() => {reject(new Error('done'))}, 1000));
const promise2 = new Promise((resolve, reject ) => {
    promise1.catch(() => {
        setTimeout(() => { resolve('done')}, 2000);
    });
});

group.addInformer(promise1, {
    failText: 'damn',
    pendingText: 'waiting',
    inProcessText: 'doing',
    doneText: 'did',
    text: 'it'
});
const informer2 = group.addInformer(null, {
    failText: 'damn',
    pendingText: 'waiting',
    inProcessText: 'doing',
    doneText: 'did',
    text: 'it'
});

setTimeout(() => {
    informer2.task = promise2;
}, 500);
0.0.10

5 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago