1.0.6 • Published 3 months ago

sequential-function-caller v1.0.6

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

repeatCalls Function

The repeatCalls function is designed for calling a function multiple times, dividing the calls into chunks and executing them sequentially.

Import

You can import the repeatCalls function in two ways, depending on your preference:

CommonJS (Node.js)

const { repeatCalls } = require('sequential-function-caller');

ES6 Modules (Browsers, Node.js with ESM)

import { repeatCalls } from 'sequential-function-caller';

Usage

import { repeatCalls } from 'sequential-function-caller';

const exampleFunction = (a) => { 
    console.log(a); 
    return a; 
};

repeatCalls({
    functionToExecute: exampleFunction,
    totalCalls: 9,
    chunkSize: 3,
    payloadArray: [1,2,3,4,5,6,7,8,9],
    delayMs: 1000
}).then(response => {
    console.log(response);
});

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.0.6

3 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

6 months ago

1.0.0

6 months ago