Q:

What's point of mapLimit?

What is point of function mapLimit in async lib? I thought that Node uses internal thread pool that limits number of async operations at a time. More over, we have single thread in Node, and it uses event loop (it means that we make one operation at a time in that thread). Can someone explain why do we need it?

A:

I finally found out the answer. It's all about our main thread in Node that processes stack of operations. 
And the main problem that we want to avoid is RangeError: Maximum call stack size exceeded. And that's it.
Let's say we have a lot of async operations and they all return some results to the main thread(to the main stack) to be precessed after they've done their work.
And the main point is here we just need to limit somehow the number of them in our stack. How? Just limit number of async operations at a time, so we don't need to handle a lot operations in our main stack after async operations have done their work.
And it's important to understand that it does not guarantee success. Because even if we have a limited number of concurrent async operations, but our sync operations in the main stack are very slow, our stack eventually will blow up and we'll get RangeError: Maximum call stack size exceeded anyway.

