1.0.5 • Published 5 years ago

timable v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Timable

Timable is a module that allow user to schedule a job on specific time ( or moment)

Install

npm install timable

Usage

Here is an example on Timable.

const 
    Timable = require('timeable'),
    moment = require('moment');

const job = Timable.schedule(
    function(){
        console.log('Hello');
    }, 
    moment().add(3, 'seconds')
);

job.on('invoke', function(){
    console.log('Job has invoked');
});

job.on('error', function(error){
    console.error(error);
});

job.on('cancel', function(){
    console.log('Job has canceled');
});

API

Events

job.on("invoke", function())

Triggered when the job is invoked

job.on("error", function())

Triggered when error caused on executing the job

job.on("cancel", function())

Triggered when user call the cancel() method

Functions

job.invoke()

Invoke the job immediately

job.cancel()

Cancel the job, and the job would remove from the scheduledJobs

Licence

MIT

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago