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

delay-map

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delay-map

In order to execute `map` with `timeout` param

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by48.15%
Maintainers
1
Weekly downloads
 
Created
Source

delay-map

In order to delay map func running with a timeout.

Basically, iterable object passed to map function will be executed one after another immediately. there is a situation you want to simluate a running with timeout. such as the next one should run with 300ms delay.

Usage

const delayMap = require('./delay-map');

const dm = new delayMap([5,8,9], function(value, key) {
  return value + key;
}, {
  timeout: 1000,
})

dm.then((res) => {
  console.log('res ', res);
})

// res: [5, 9, 11]

API

delay-map(iterable, func, [options])

input

Type: Iterable<Promise|any>

func(item, index)

Type: Function

options

Type: Object

timeout

License

MIT

Keywords

FAQs

Package last updated on 19 Dec 2017

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