1.0.1 • Published 12 months ago

execute-sequentially v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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();
1.0.1

12 months ago

1.0.0

12 months ago