execute-sequentially
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

README.md 示例

# execute-sequentially

'ExecuteSequentially' is a class for executing functions sequentially. It allows adding functions to a queue and ensures they are executed one by one. The class also supports pausing and stopping the execution of the queue.

## Features

- Execute callbacks sequentially

## Installation

To install the package, you can use npm:

```bash
npm install execute-sequentially
```

Usage

Importing the Library

const { ExecuteSequentially } = require("execute-sequentially");

Execute Callbacks Sequentially

Start execution immediately after adding

const executeSequentially = new ExecuteSequentially();

executeSequentially.push(async () =>
  fs.promises.appendFile("./filePath", `${data}\n`)
);

executeSequentially.push(fn);

executeSequentially.executePause();

executeSequentially.executeStart();

executeSequentially.executeStop();

Package Sidebar

Install

npm i execute-sequentially

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

7

Last publish

Collaborators

  • handdeng