jchecks

0.1.2 • Public • Published

jchecks

NPM version Build Status Coverage Status

checklist

使用方法

示例

  var flag = 0;
  var flagTimer = setInterval(function () {
      flag++;
  }, 1000);
  var checklist = new jchecks.Checklist({
    items: [{
      checker: function () {
        console.log('checker 1')
        return flag > 0
      },
      processor: function () {
        console.log('processor 1')
        return null
      },
      timeout: 5000,
    }, {
      checker: function () {
        console.log('checker 2')
        return flag > 3
      },
      processor: function () {
        console.log('processor 2')
        return null
      },
    }]
  });
 
  checklist.on('error', function (error) {
    console.error(error);
  }).on('stop', function () {
    console.info('stop');
  });

License

MIT © zswang

Readme

Keywords

Package Sidebar

Install

npm i jchecks

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • zswang