什么图书馆的NodeJS最像jQuery的deferreds? [英] What nodejs library is most like jQuery's deferreds?
问题描述
我已经成为jQuery的新和惊人的递延模块的熟练用户,因为我将缓和使用更多的Node.js的,我发现自己想要的东西完全像它在很大程度上我的Node.js编程:回调该块直到许诺的集合,转予解决,与自由添加到阵列上的飞作为任务中complexity--生长,当一个处理数据的一个树,如,它的大小不能在公知的的任务的开始
I've become a skilled user of jQuery's new and amazing Deferred module, and as I'm easing into using more of Node.js, I find myself wanting something exactly like it in much of my Node.js programming: callbacks that block until a collection of promises devolves to resolved, with the freedom to add to the array on-the-fly as the task grows in complexity-- such as when one processes a tree of data, the size of which is not known at the start of the task.
但节点纤维
需要一个全新的可执行文件, Q()的接口只是该死的混乱
,和节点步
似乎只处理单任务同步。
But node-fibers
requires a whole new executable, Q()
's interface is just damned confusing, and node-step
only seems to handle single-task synchronizations.
已经有人刚刚移植jQuery的Deferreds到一个节点准备形成的?它似乎并不认为不太可能,也没有看起来Deferreds取决于DOM可用的功能,但我还没有找到一个服务器端等效的。
Has someone just ported jQuery's Deferreds to a node-ready form? It doesn't seem that unlikely, nor does it seem that Deferreds is dependent upon DOM-available features, but I haven't found a server-side equivalent.
推荐答案
这个节点库看起来在功能上非常相似,jQuery的递延:
This node library looks quite similar in functionality to jQuery's Deferred:
https://github.com/kriszyp/node-promise
这篇关于什么图书馆的NodeJS最像jQuery的deferreds?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!