Socket
Socket
Sign inDemoInstall

maplex

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    maplex

An asynchronous, multiplexed iterable mapper


Version published
Weekly downloads
1.8K
increased by18.16%
Maintainers
1
Install size
813 kB
Created
Weekly downloads
 

Readme

Source

Maplex

A multiplexed mapper

I do a huge amount of work just via map/filter/reduce in js, but the one pattern that has never fit cleanly into this pattern is wanting to produce a single map output from many different parallel arrays, asynchronously (and thus, innately yeilding). This does that.

Usage

    import { Maplex } from 'maplex';
    // or
    const { Maplex } = require('maplex');
    Maplex.map(arrayA, ... arrayN, function(itemA, ... itemN){
        //do your work here and store it in finalItem
        return finalItem;
    }, function(result){
        //do something with your mapped value
    });

If you omit the completion function the results are not gathered, which is useful in streaming cases.

Testing

Just run mocha

Enjoy,

-Abbey Hawk Sparrow

FAQs

Last updated on 22 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc