New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

q-tools

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q-tools

Extends Q with each and map.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

q-tools

Extends Q with map and each methods.

Allows execution of a particular function for every value in an array. If the array contains promises the supplied function will not be called until all promises have been resolved.

map

map returns an array with the results of calling fn for each item in the array.

function double(x) {
    return x * 2;
}

var doubled = Q.map(original, double);

// if you want to do parallel processing use mapAsync instead.
var doubledParallel = Q.mapAsync(original, double);

each

each returns the original array after having called fn for each item. Use this method instead of map if you don’t need the transformed values.

function double(x) {
    return x * 2;
}

Q.each(original, double);

// process `original` in parallell
Q.eachAsync(original, double);

Keywords

q

FAQs

Package last updated on 03 Aug 2015

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