New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@ludovicm67/scheduler

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ludovicm67/scheduler

A simple Node.js based tasks and services scheduler

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

Node scheduler

NPM

A simple Node.js based tasks and services scheduler.

Concepts

Process

A process is something that runs continuously. It is started when the scheduler starts and kept running. If it crashes, it is restarted by default.

Task

A task is something that runs once and then stops. It should be started manually when needed using a HTTP request or through a schedule.

Schedule

A schedule is a way to run tasks automatically at specific times or intervals, without manual intervention. Schedules are defined using cron syntax.

Quick Start

npx @ludovicm67/scheduler -c ./path/to/scheduler-config.yaml

Where -c is the path to your configuration file. If not provided, it defaults to ./scheduler-config.yaml or to the value of the SCHEDULER_CONFIG_PATH environment variable if it is defined.

The configuration file is a YAML file that defines the processes, tasks, and schedules to be managed by the scheduler.

An example of configuration file is available here: scheduler-config.yaml.

You can control the log level using the LOG_LEVEL environment variable. It defaults to info, but you can set it to debug, warn, error, etc. depending on your needs, or silent to disable them.

Configuration File Structure

The configuration file is a YAML object with three main sections: processes, tasks, and schedules. Each section is an object whose keys are unique names, and values are configuration objects.

Top-Level Keys

KeyDescriptionTypeRequired
processesProcesses to run continuouslyobjectNo
tasksOne-off tasks to runobjectNo
schedulesScheduled tasks (using cron syntax)objectNo

1. processes and tasks Structure

Both processes and tasks have similar structure. Each key is a unique name, and the value is an object with these properties:

PropertyDescriptionTypeRequiredDefault
cmdThe command to executestringYes
argsArguments to pass to the commandarrayNo[]
restartRestart if exits (processes: default true, tasks: default false)booleanNosee left
uniqueOnly one instance can run at a timebooleanNotrue
logsLog file paths (see below)objectYes

logs object (required):

PropertyDescriptionTypeRequired
stdoutPath to standard output log filestringYes
stderrPath to standard error log filestringYes

2. schedules Structure

Each key is a unique name, and the value is an object:

PropertyDescriptionTypeRequired
cronCron expression for schedulingstringYes
taskName of the task to runstringYes

Example

processes:
  my-process:
    cmd: "node"
    args: ["server.js"]
    restart: true
    unique: true
    logs:
      stdout: "/var/log/my-process.out"
      stderr: "/var/log/my-process.err"

tasks:
  my-task:
    cmd: "npm"
    args: ["run", "build"]
    restart: false
    unique: true
    logs:
      stdout: "/var/log/my-task.out"
      stderr: "/var/log/my-task.err"

schedules:
  nightly-build:
    cron: "0 2 * * *"
    task: "my-task"

Notes:

  • All keys under processes, tasks, and schedules must be unique.
  • No additional properties are allowed outside the defined structure.

License

Node scheduler is licensed under the Apache-2.0 license.

Keywords

scheduler

FAQs

Package last updated on 23 Apr 2026

Related posts