A simple and lightweight task scheduler package for Node.js applications.
You can install the package via npm:
npm install my-task-scheduler
## Usage
```javascript
const TaskScheduler = require('my-task-scheduler');
// Create a new instance of TaskScheduler
const scheduler = new TaskScheduler();
// Schedule a task to be executed after 5 seconds
const taskObject = scheduler.scheduleTask(() => {
console.log('Task executed!');
}, 5000);
console.log('Task scheduled:', taskObject);
Schedules a task to be executed after a specified delay.
-
task
: The function to be executed as the task. -
delay
: The delay (in milliseconds) after which the task should be executed.
Returns an object representing the scheduled task.
TThis package is open source and available under the MIT License. LICENSE file for details.