1.0.0 • Published 1 year ago

strimanga v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Strimanga

Strimanga is a simple task scheduling library for JavaScript, allowing you to schedule tasks to run at specific intervals.

Installation

To install Strimanga, you can use npm:

npm install strimanga

Usage

const Strimanga = require('strimanga');

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

// Define a task function
function task() {
  console.log('Task executed');
}

// Schedule the task to run every 1 second
scheduler.scheduleTask(task, 1000);

// Stop the scheduler after some time
setTimeout(() => {
  scheduler.stop();
  console.log('Scheduler stopped');
}, 10000); // Stop the scheduler after 10 seconds

API

scheduleTask(task, interval)

Schedules a task to run at a specific interval.

  • task: Function to be executed at the specified interval.
  • interval: Interval (in milliseconds) at which the task should run.

stop()

Stops the scheduler, preventing any further execution of scheduled tasks.

License

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

1.0.0

1 year ago