@skazska/inform
[![Build Status](https://travis-ci.org/skazska/inform.svg?branch=master)](https://travis-ci.org/skazska/inform)
Last updated a year ago by skazska .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @skazska/inform -g
SYNC missed versions from official npm registry.

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


Current Tags

  • 0.0.10                                ...           latest (a year ago)

11 Versions

  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 11
Dependencies (1)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |