Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@joemccann/flood

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@joemccann/flood

🌊 Flood a network with requests in batches with retries.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Flood

🌊 Flood a network with requests in batches with retries.

Usage

npm i -S @joemccann/flood
const flood = require('@joemccann/flood')

const data = {
  batchSize: 50, // The number of simultaneous requests...
  done: (data) => {
    // write to file or console.dir(data)
    // Data is an array of objects of type {data: [...], url: 'http://...'}
  },
  errorHandler: (e, results) => { 
    console.error(e) 
    // do something with the results maybe?
  },
  sleepTime: 100, // sleep in between batches, not each request; in milliseconds
  url: `http://localhost:8080/api/foo?id={iteration}`, // {iteration} is REQUIRED
  values: ['a','b','c'] // the value to update on the query string
}

try{
  const { data, err } = await flood(data)
  console.dir(data) // data is the same data passed into done()
} catch(e) {
  console.error(e)
}

NOTE: The retries will go on forever so be wise about how you handle the errors.

Tests

npm i -D
npm test

Authors

  • Joe McCann

LICENSE

MIT

Keywords

FAQs

Package last updated on 20 Jul 2020

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