Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

sequential-chucks-caller

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

  • 1.0.4
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc