How to properly write the following set of loops in Node.Js without blocking the event loop or without causing out of memory error.

What I have tried so far includes

* Combinations of setImmediate()/setInterval()
* The Async module [see my code here](https://gist.github.com/anonymous/7c1a480095e20e253ce1df3084cdb11f)
* Thread\_a\_gogo (this module is no more maintained)

The code.

```
for(var i = 0; i < 2000; i++)
    for(var j = 0; i < 2000; j++)
        for(var k = 0; k < 2000; k++)
            console.log(i + ":" + j + ":" + k);

```

Also created a JSFiddle to play around [here](https://jsfiddle.net/zbzyqjdp/)