Skip to content

roddawr/remadel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Task Scheduler

Task Scheduler is a simple Node.js package that allows you to schedule tasks to run at specified intervals within your applications.

Installation

You can install Task Scheduler via npm:

npm install task-scheduler

Usage

const TaskScheduler = require('task-scheduler');

// Create an instance of TaskScheduler
const scheduler = new TaskScheduler();

// Define a task function
function myTask() {
  console.log('Running my task...');
}

// Schedule the task to run every 5 seconds
scheduler.scheduleTask(myTask, 5);

// To stop the scheduler (optional)
// scheduler.stop();

API

constructor()

Initializes the TaskScheduler instance.

scheduleTask(task, intervalInSeconds)

Schedules a task to run at a specified interval.

  • task: A function representing the task to be scheduled.
  • intervalInSeconds: The interval in seconds at which the task should run.

stop()

Stops the task scheduler.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published