New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-map-async

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-map-async

Array.map with sequential processing async/await

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Array.mapAsync

Array.map with sequential processing async/await

Installation:

Install the dependency

npm i array-map-async --save

Usage:

You need only import package and use Array like .map

import 'array-map-async';

//  sleep() demo function
const sleep = (milliseconds) => new Promise(resolve => setTimeout(() => { resolve() }, milliseconds));

(async () => {
    const results = await [1,2,3].mapAsync(async (item, index)=> {
        console.log("sleep 1s")
        await sleep(1000);  // or fetch/timer/any Promise
        console.log(item)
        return `#${item}`;
    });
    console.log(results);
})();


//  Results
//
//  sleep 1s
//  1
//
//  sleep 1s
//  2
//
//  sleep 1s
//  3
//
//  ["#1","#2","#3"]

Keywords

FAQs

Package last updated on 05 Nov 2022

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