Registry / devops / blazerjob

blazerjob

JSON →
library2.0.7jsnpmunverified

BlazerJob is a lightweight, SQLite-backed task scheduler for Node.js and TypeScript applications, currently at version 2.0.7. It supports scheduling and executing asynchronous tasks (custom functions or HTTP requests) with configurable concurrency, intervals, and max runs. Unlike many task schedulers, BlazerJob offers both in-memory (default) and persistent SQLite storage options, and includes an optional built-in Fastify HTTP server for task management via REST API. The library ships with TypeScript definitions and is designed for simplicity and performance.

npm install blazerjob
INSTALL
IMPORT
SIG · BLAZERJOB
B
blazerjob
devopsjavascriptv2.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BlazeJob
import { BlazeJob } from 'blazerjob'
const BlazeJob = require('blazerjob')
ESM-only; named export. CommonJS require will fail.
startServer
import { startServer } from 'blazerjob'
import startServer from 'blazerjob'
Named export, not default import.
JobTask
import type { JobTask } from 'blazerjob'
import { JobTask } from 'blazerjob'
Type-only import if using TypeScript for runtime code.

Creates a scheduler with in-memory storage, schedules a custom async task to run immediately and every 5 seconds for 3 times, then starts the scheduler.

import { BlazeJob } from 'blazerjob'; const jobs = new BlazeJob({ concurrency: 4 }); jobs.schedule(async () => { console.log('Hello from custom task!'); }, { runAt: new Date(), interval: 5000, maxRuns: 3 }); await jobs.start(); console.log('Scheduler started');
Debug
Known issues
gotchaCustom task functions are stored in memory only, not persisted to SQLite. Use HTTP tasks or store logic externally for persistence across restarts.
fix
For persistent custom tasks, serialize the logic or use HTTP tasks with a webhook endpoint.
affects: >=2.0.0
gotchaHTTP server (startServer) uses in-memory storage by default. Tasks scheduled via API are lost on server restart.
fix
Pass storage options when starting server (currently not configurable via startServer directly; need to modify BlazeJob instance).
affects: >=2.0.0
breakingVersion 2.0 changed the API: BlazeJob constructor now expects an options object, not separate arguments.
fix
Use new BlazeJob({ concurrency: 4 }) instead of new BlazeJob(4).
affects: >=2.0.0
deprecatedThe HTTP task type uses JSON.stringify for config; this may be deprecated in favor of object config in future versions.
fix
Use stringified config for now; watch for updates.
affects: >=2.0.0
gotchaConcurrency is global; all tasks share the same concurrency limit. High concurrency may exhaust system resources.
fix
Set concurrency based on your system and task load.
affects: >=2.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using CommonJS require() to import an ESM-only package.
fix
Use import { BlazeJob } from 'blazerjob' in your project (ensure "type": "module" in package.json or use .mjs extension).
TypeError: BlazeJob is not a constructor
Using default import instead of named import.
fix
Use import { BlazeJob } from 'blazerjob'.
Error: Cannot find module 'better-sqlite3'
SQLite storage requested but optional dependency not installed.
fix
Run npm install better-sqlite3 to install the SQLite binding.
Upgrade
Version history
2.0.7latest on npm
Audit
Dependencies
better-sqlite3optionalSQLite binding for persistent storage
fastifyoptionalHTTP server for REST API endpoints
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
blazerjob — npm install blazerjob · libregistry