simerfop

1.0.0 • Public • Published

Simerfop

A simple task scheduler for Node.js applications.

Installation

You can install Simerfop via npm:

npm install simerfop

Usage

const Simerfop = require('simerfop');

const scheduler = new Simerfop();

// Example usage:
scheduler.schedule(() => {
  console.log('Task executed at', new Date());
}, Date.now() + 5000); // Schedule task 5 seconds from now

scheduler.schedule(() => {
  console.log('Another task executed at', new Date());
}, Date.now() + 10000); // Schedule another task 10 seconds from now

Documentation

Constructor

Creates a new instance of the scheduler.

schedule(task, time)

Schedules a task to run at a specific time.

  • task: Function to execute.
  • time: Time at which the task should run (in milliseconds since the Unix epoch).

clear()

Clears all scheduled tasks and stops the scheduler.

License

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

Readme

Keywords

Package Sidebar

Install

npm i simerfop

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.68 kB

Total Files

3

Last publish

Collaborators

  • 0semter0