For-loop and async callback in node.js?

后端 未结 3 1336
猫巷女王i
猫巷女王i 2020-12-05 02:49

I\'m new to JavaScript and to node.js. I want to loop through a directory and add all file stat (not other directories) to an array. As you see below there is a problem with

3条回答
  •  盖世英雄少女心
    2020-12-05 03:29

    Alternatively use the new threads module ( https://github.com/robtweed/Q-Oper8 ) and then you can do all this stuff much more simply using standard synchronous coding within the threads child processes, since they only deal with one user's request at a time.

    Goodbye to async logic and nested callbacks!

提交回复
热议问题