UNPKG

blazerjob

Version:

TypeScript library for scheduling, executing, and managing asynchronous tasks (custom, HTTP, Cosmos) with a SQLite backend.

16 lines (15 loc) 508 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../index"); const jobs = new index_1.BlazeJob({ dbPath: './tasks_http.db' }); jobs.schedule(async () => { }, { runAt: new Date(Date.now() + 1000), type: 'http', config: JSON.stringify({ url: 'https://httpbin.org/post', method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: 'Hello BlazeJob!' }) }) }); jobs.start();