New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

timable

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timable

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

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

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

Keywords

schedule

FAQs

Package last updated on 01 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts