jobr

jobr is a simple, lightweight library that makes easy to create and manage recurrent jobs. Works in browser and node environment.

Usage no npm install needed!

<script type="module">
  import jobr from 'https://cdn.skypack.dev/jobr';
</script>

README

Jobr

Jobr is a simple, lightweight library that makes easy to create and manage recurrent jobs. Works in browser and node environment.

Table of Contents

Installation

To install with npm, please execute following command;

npm install jobr

To install with yarn, please execute following command;

yarn add jobr

Usage

Node

import { RecurrentJob } from "jobr";

const recurrentJob = new RecurrentJob({
  name: "hello",
  task: () => "hello world",
  interval: 1000,
  stopOnFail: false
});

const unsubscribe = recurrentJob.subscribe("success", (data) => {
  console.log(data);
});

recurrentJob.start();

unsubscribe();

Browser

if you're just using