Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 4, 2024 via pnpm
Package summary
Share
0
issues
1
license
1
MIT
Package created
21 Oct 2016
Version published
22 Apr 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
p-map@6.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of p-map 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does p-map do?

The "p-map" NPM package is designed for mapping over promises concurrently. It is particularly useful when you have multiple promise-returning or async functions that need to run simultaneously with different inputs. This package offers a different approach compared to Promise.all(), as it allows you to not only control concurrency, but also decide whether or not to stop iteration when there's an error.

How do you use p-map?

To use the p-map package, you first need to install it using npm with the command npm install p-map. Once installed, you can import it into your JavaScript file. Here's an example of how to use it:

import pMap from 'p-map';
import got from 'got';

const sites = [
	getWebsiteFromUsername('sindresorhus'), //=> Promise
	'https://avajs.dev',
	'https://github.com'
];

const mapper = async site => {
	const {requestUrl} = await got.head(site);
	return requestUrl;
};

const result = await pMap(sites, mapper, {concurrency: 2});

console.log(result);
//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']

In the above example, p-map is used to concurrently send GET requests to an array of websites and waits until they all respond before printing out a resulting array of the URLs.

Where are the p-map docs?

The documentation for "p-map" can be found within the README.md file of its GitHub repository, available at https://github.com/sindresorhus/p-map. The documentation includes an overview of the package's functions and how to use it, along with its API specifications, options, and examples of how to integrate it into your code.