tshedpandapsy
v0.1.0
Published
Task Scheduler: package that allows developers to schedule and manage recurring tasks in their Node.js applications. This could include features like cron job scheduling, task queuing, and error handling.
Downloads
3
Readme
My Task Scheduler
A simple and lightweight task scheduler package for Node.js applications.
Installation
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);
API
scheduleTask(task, delay)
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.
License
TThis package is open source and available under the MIT License. LICENSE file for details.