You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@ijx/tasks

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ijx/tasks

Task manager

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Tasks

Manager for task list

Installation

Use the package manager npm to install Tasks.

npm install @ijx/tasks

List of methods

  • constructor(config?: object) Constructor
  • onEnd(func: function): Tasks Execute function after end event
  • add(action: function|object): Tasks Add new task to list
  • process(): void Start to process task list
  • pause(): void Pause task list
  • reset(): void Clear task list and stop

Example usage

// Import module
import Tasks from "@ijx/tasks"

// Create variable and settings
const tasks = new Tasks({
    auto: true // Start process with add function, default true
});
tasks.onEnd(() => console.log("Finish all tasks!"));

// Add tasks
tasks.add(async () => {
    // Slow function 1
});
tasks.add(async () => {
    // Slow function 2
});

Keywords

Task

FAQs

Package last updated on 30 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts