# timable

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

Latest version **1.0.5** (published 2019-04-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install timable
pnpm add timable
yarn add timable
bun add timable
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-04-01 |
| First published | 2019-03-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ken.yip |
| Maintainers | ken20206 |
| Keywords | schedule |

## Links

- npm: https://www.npmjs.com/package/timable
- Repository: https://github.com/ken20206/Timable
- Issues: https://github.com/ken20206/Timable/issues
- npm.io page: https://npm.io/package/timable

## Dependencies (3)

- [moment](https://npm.io/package/moment.md) ^2.24.0
- [long-timeout](https://npm.io/package/long-timeout.md) ^0.1.1
- [lodash.sortby](https://npm.io/package/lodash.sortby.md) ^4.7.0

## Recent versions

- 1.0.5 (latest) — 2019-04-01
- 1.0.4 — 2019-03-14
- 1.0.3 — 2019-03-13
- 1.0.2 — 2019-03-13
- 1.0.1 — 2019-03-13
- 1.0.0 — 2019-03-13

## README

# 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.

```js
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

---
_Source: https://npm.io/package/timable · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
