strimanga

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i strimanga

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.16 kB

Total Files

3

Last publish

Collaborators

  • samkiller14444