Does node.js support yield?

后端 未结 10 673
误落风尘
误落风尘 2021-01-31 01:51

Is there any way to get generators into node.js?

I\'m currently faking them with callbacks, but I have to remember to check the response of the callback inside of my gen

10条回答
  •  再見小時候
    2021-01-31 02:56

    Yes, since version 0.11. Enjoy!

    http://wingolog.org/archives/2013/05/08/generators-in-v8

    http://jlongster.com/A-Study-on-Solving-Callbacks-with-JavaScript-Generators

提交回复
热议问题