dieslow666

1.0.3 • Public • Published

Task Scheduler

Task Scheduler is a simple JavaScript package that allows you to schedule tasks to run at specified intervals.

Installation

You can install the Task Scheduler package via npm:

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

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

// Add some tasks
scheduler.addTask('Task 1', 2000, () => {
    console.log('Executing Task 1');
});
scheduler.addTask('Task 2', 3000, () => {
    console.log('Executing Task 2');
});

// Start the scheduler
scheduler.startScheduler();

// List all tasks
scheduler.listTasks();

// Stop the scheduler after 10 seconds
setTimeout(() => {
    scheduler.stopScheduler();
}, 10000);

Readme

Keywords

none

Package Sidebar

Install

npm i dieslow666

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

2.5 kB

Total Files

3

Last publish

Collaborators

  • dieslow66