🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

sequential-chucks-caller

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

sequential-chucks-caller

Package for dividing multiple function calls into chunks and executing them sequentially.

unpublished
latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

executeChunks Function

The executeChunks function is designed to execute a specified function multiple times, sequentially in chunks, handling promises, and allowing for delays between each chunk. This can be particularly useful when dealing with large sets of data or when there's a need to manage execution over time.

Import

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

CommonJS (Node.js)

const { executeChunks } = require('sequential-chunks-caller');

ES6 Modules (Browsers, Node.js with ESM)

import { executeChunks } from 'sequential-chunks-caller';

Usage

import { executeChunks } from 'sequential-chunks-caller';

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

const result = await executeChunks({
    functionToExecute: exampleFunction,
    totalCalls: 5,
    chunkSize: 2,
    payloadArray: [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]],
    delaySeconds: 1
});

License

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

Keywords

sequential

FAQs

Package last updated on 19 Nov 2023

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