Node.js async to sync

后端 未结 5 1017
走了就别回头了
走了就别回头了 2020-12-13 19:44

How can I make this work

var asyncToSync = syncFunc();

function syncFunc() {
    var sync = true;
    var data = null;
    query(params, function(result){
          


        
5条回答
  •  粉色の甜心
    2020-12-13 20:04

    I've been using syncrhonize.js with great success. There's even a pending pull request (which works quite well) to support async functions which have multiple parameters. Far better and easier to use than node-sync imho. Added bonus that it has easy-to-understand and thorough documentation, whereas node-sync does not.

提交回复
热议问题