Scan your whole stack
From OX Research Newsroom
Are you using aldareth?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.0-beta.2
aldareth was last scanned on 27 Nov 2026 at version 0.2.0-beta.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.0-beta.2 LATEST | 27 Nov 2026 | No rules fired |
| 0.2.0-beta.1 | 17 Nov 2026 | No rules fired |
| 0.1.0-beta.3 | 23 Oct 2026 | No rules fired |
| 0.1.0-beta.2 | 22 Oct 2026 | Not shown |
| 0.1.0-beta.1 | 1 Oct 2026 | Not shown |
Findings for v0.2.0-beta.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.0-beta.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A job queue and cron scheduler for Node.js, backed by MySQL or MongoDB.
Jobs are plain classes. Your app pushes them into the database, a worker process runs them. The database is the source of truth — if a worker dies, its jobs come back.
require() it too, on Node >= 20.19 / 22.12npm install aldareth
npx aldareth init
This writes src/aldareth.ts (the config module), src/worker.ts, src/schedule.ts,
src/run-schedule.ts, a .env with a placeholder connection, and three npm scripts.
Nothing that already exists is overwritten, so it is safe to run twice.
It asks where the files should go — press Enter to keep src:
Folder for the Aldareth files [src]:
Answer it upfront instead with --dir:
npx aldareth init --dir=app/queue
src/aldareth.ts # the job classes — the worker needs them to run jobs by name
src/worker.ts # worker process entry
src/schedule.ts # the Schedule instance
src/run-schedule.ts # scheduler process entry
.env # ALDARETH_DB_URL
package.json # migrate, worker, schedule
Install the TypeScript runner it points at:
npm install --save-dev tsx
# .env
ALDARETH_DB_URL=mysql://root:secret@127.0.0.1:3306/aldareth
A job is a class with a unique name and a handle() method.
// src/jobs/send-email.ts
import { Job } from 'aldareth';
export class SendEmailJob extends Job {
static jobName = 'send-email';
async handle() {
console.log('Sending email to:', this.data.to);
// await sendEmail(this.data);
}
}
// src/aldareth.ts
import { createAldareth } from 'aldareth';
import { SendEmailJob } from './jobs/send-email.js';
export default createAldareth({
jobs: [SendEmailJob],
});
npm run migrate
Once per database, before the first worker. It creates the table (MySQL) or the indexes (MongoDB).
import { SendEmailJob } from './jobs/send-email.js';
await SendEmailJob.dispatch({ to: 'user@example.com', subject: 'Hello' });
npm run worker
The worker picks the job up, runs handle(), and removes it when it is done.
Everything is resolved from the environment first, and from the config module second.
| Setting | Environment | In code | Default |
|---|---|---|---|
| Connection | ALDARETH_DB_URL |
connection |
required |
| Driver | ALDARETH_DRIVER |
driver |
from the URI |
| Table/collection | ALDARETH_PREFIX |
opts.prefix |
aldareth_ |
| Delete finished jobs | — | opts.removeOnComplete |
true |
| Job classes | — | jobs |
required |
mysql or mongodb; the URI scheme decides when ALDARETH_DRIVER is unset.PoolOptions object — it
carries options a URI cannot express (ssl, socketPath), so it is always used as-is.The CLI loads .env from the working directory by itself. The library does not — your app
is responsible (node --env-file=.env dist/server.js, or dotenv).
import { createAldareth, defineConfig } from 'aldareth';
// defineConfig is optional — it only keeps the type without an explicit annotation
export default defineConfig({ jobs: [SendEmailJob] });
| Property | Type | Default | Description |
|---|---|---|---|
jobName |
string |
(required) | Unique identifier of the job class |
tries |
number |
3 |
Attempts before the job fails |
backoff |
number[] |
[10, 60, 300] |
Seconds to wait before each retry |
timeout |
number |
— | Seconds before the attempt is aborted |
queue |
string |
'default' |
Queue the job is dispatched to |
failed(error) is optional and runs only when the job has failed for good, not on every
retry.
Worth knowing:
jobName must be unique across all registered jobs — registering it twice throws.queue and tries, so keep the constructor
argument-free and free of side effects.Give the job a type parameter and the payload is checked where you dispatch it.
interface EmailPayload {
to: string;
subject: string;
}
export class SendEmailJob extends Job<EmailPayload> {
static jobName = 'send-email';
async handle() {
await sendEmail(this.data.to, this.data.subject);
}
}
SendEmailJob.dispatch({ to: 'user@example.com', subject: 'Hello' }); // ok
SendEmailJob.dispatch({ to: 'user@example.com' }); // error: subject is missing
This is a compile-time guarantee only — the payload is stored as JSON, so nothing validates
it again when a worker picks the job up. A job without a type parameter takes unknown.
import { getDefaultQueue } from 'aldareth';
import { ReportJob } from './jobs/report.js';
// through the class
await ReportJob.dispatch({ month: 3 });
// through the queue, with options
await getDefaultQueue().dispatch(ReportJob, { month: 3 }, { delay: 30, queue: 'reports' });
| Option | Type | Description |
|---|---|---|
delay |
number |
Seconds until the job becomes due |
queue |
string |
Queue to put the job in |
Job.dispatch() builds its queue from the environment on first use — no createAldareth()
call and no import needed. Without ALDARETH_DB_URL it throws Koneksi database belum diatur.
Always await the dispatch. If the result is dropped, Aldareth prints a dispatch() result was not awaited warning: the request can finish before the job is enqueued.
A worker claims jobs, runs them, and settles the outcome. The entry point written by
init starts one:
// src/worker.ts
import aldareth from './aldareth.js';
aldareth.work({ stopWhenEmpty: true, maxTime: 55 }).catch((err) => {
console.error(err);
process.exit(1);
});
| Option | Type | Default | Description |
|---|---|---|---|
stopWhenEmpty |
boolean |
false |
Exit as soon as the queues are empty |
maxTime |
number |
50 |
Max runtime in seconds |
maxJobs |
number |
— | Stop after this many jobs |
queues |
string[] |
['default'] |
Queues to listen on |
The worker exits by itself when it is done — as soon as the queues are empty, or when
maxTime is up. Whatever starts your processes (a process manager, a cron entry, your dev
loop) can start it again.
To attach a custom reporter, build the worker yourself:
import { Worker } from 'aldareth';
import aldareth from './aldareth.js';
const worker = new Worker(aldareth.driver, aldareth.registry, {
queues: ['default'],
maxTimeMs: 50_000,
leaseSeconds: 110,
workerId: 'worker-1',
reporter,
});
const result = await worker.run();
| Option | Type | Default | Description |
|---|---|---|---|
queues |
string[] |
['default'] |
Queues to listen on |
maxTimeMs |
number |
50000 |
Max runtime in milliseconds |
maxJobs |
number |
— | Max jobs before exiting |
stopWhenEmpty |
boolean |
false |
Exit when all queues are empty |
pollMs |
number |
1000 |
Poll interval in milliseconds |
leaseSeconds |
number |
maxTime + 60 |
How long a claimed job stays locked |
graceMs |
number |
5000 |
Time reserved for the running job at the end |
workerId |
string |
${hostname}:${pid} |
Unique worker identifier |
reporter |
Reporter |
consoleReporter |
Event reporter |
graceMs has to be smaller than maxTimeMs, and a job's timeout has to fit in both
maxTimeMs and leaseSeconds — otherwise the job is rejected as failed instead of
retried. A few seconds before the deadline the worker stops claiming new jobs and lets the
running one finish.
A reporter is a function that receives one event object.
import type { Reporter } from 'aldareth';
const reporter: Reporter = (event) => {
if (event.type === 'job:fail') {
console.error(`job ${event.name} failed: ${event.error}`);
}
};
| Event | Payload | Meaning |
|---|---|---|
worker:start |
workerId, queues |
The worker started |
job:start |
id, name, attempt, maxAttempts |
A job was claimed and is being handled |
job:done |
id, name, ms |
A job finished successfully |
job:retry |
id, name, ms, error, delaySeconds, attempt, maxAttempts |
A job failed and will be retried |
job:fail |
id, name, ms, error |
A job failed for good |
job:defer |
id, name |
Put back — not enough time left in this run |
job:lease-lost |
id, name |
Another worker took over the job |
worker:stop |
processed, timedOut |
The worker stopped |
The scheduler dispatches jobs on a cron expression. It uses the same queue, so it is a separate process that imports the config module.
// src/schedule.ts
import { Schedule } from 'aldareth';
import aldareth from './aldareth.js';
import { SendReportJob } from './jobs/send-report.js';
const schedule = new Schedule({
timezone: 'Asia/Jakarta',
hasActive: (jobName) => aldareth.driver.hasActive(jobName),
});
schedule.job(SendReportJob).dailyAt('08:00');
schedule.fn({ jobName: 'cleanup', handle: async () => { /* ... */ } }).everyFiveMinutes();
export default schedule;
Run it from the entry point written by init:
// src/run-schedule.ts
import { scheduleRun } from 'aldareth';
import schedule from './schedule.js';
// once: dispatch whatever is due this minute, then return
scheduleRun(schedule, { once: true }).then(() => process.exit(0));
| Option | Type | Default | Description |
|---|---|---|---|
intervalMs |
number |
60000 |
How often to re-check the tasks |
onEvent |
(event) => void |
consoleScheduleReporter |
Event reporter |
once |
boolean |
false |
Run the due tasks, then return |
Without once the same call loops forever, checking the tasks every minute. With once it
runs a single pass — the mode for hosts where only cron is available. The explicit
process.exit() in the snippet is needed because the queue keeps its connection pool open.
The same options work on aldareth.scheduleRun(), which resolves the schedule from the
config module instead of taking an instance.
| Method | Cron equivalent | Description |
|---|---|---|
everyMinute() |
* * * * * |
Run every minute |
everyMinutes(n) |
*/n * * * * |
Run every n minutes (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) |
everyFiveMinutes() |
*/5 * * * * |
Run every five minutes |
hourlyAt(minute) |
${m} * * * * |
Minute past the hour (0–59) |
dailyAt(time) |
${m} ${h} * * * |
Daily at HH:MM |
weeklyOn(day, time) |
${m} ${h} * * ${d} |
Weekly on a day (0 = Sunday) |
monthlyOn(day, time) |
${m} ${h} ${d} * * |
Monthly on a day (1–28) |
monthlyOnLastDate(time) |
${m} ${h} L * * |
Last day of the month |
| Option on a task | Description |
|---|---|
timezone(tz) |
Timezone for this task |
withoutOverlapping() |
Skip the run while the previous job is still active |
name(n) |
Name used in reports (defaults to jobName) |
| Option on a schedule | Type | Default | Description |
|---|---|---|---|
timezone |
string |
'UTC' |
Default timezone for tasks |
hasActive |
(jobName) => Promise<boolean> |
— | Required by withoutOverlapping() |
onEvent |
(event) => void |
consoleScheduleReporter |
Event reporter |
withoutOverlapping() asks the database whether a job with that name is still pending or
running; without hasActive the schedule throws when the task is defined.
| Event | Payload | Meaning |
|---|---|---|
schedule:dispatched |
task |
The task was dispatched |
schedule:skipped-overlap |
task |
Skipped — the previous run is still active |
schedule:error |
task, error |
The task handler threw |
One failing task does not stop the others.
npx aldareth init # scaffold the files and the npm scripts
npx aldareth migrate # create/verify the queue storage
npx aldareth queue:work # start a worker
npx aldareth schedule:run # start the scheduler Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.