execution-queue
A javascript/typescript queue that runs functions sequentially.
When you add one function it will be pushed to the queue and run.
If you add more functions they will be pushed to the queue and they will be run, one by one.
Only one function is executed at time.
📝 Table of Contents
🧐 About
Executes a queue of functions one by one
🏁 Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
- NodeJs
Installing
Using npm:
npm install execution-queue
Using yarn:
yarn add execution-queue
🔧 Running the tests
Test are jest based, so
-
path_to_jest --config jest.config.js
i.e. ./node_modules/.bin/jest --config jest.config.js
🎈 Usage
const { ExecutionQueue } = require("execution-queue");
const executionQueue = new ExecutionQueue();
executionQueue.push(() => {
console.log("Hello world!");
});
executionQueue.push(() => {
console.log("Hello world 2!");
});
⛏️ Built Using
- NodeJs - Server Environment
✍️ Authors
- (https://github.com/fbrisa) - Francesco