Comment on Sane Async Patterns in JavaScriptComments−quarterto13y Next time you're about to define a function with a callback argument, don't. No, do. It's the prevailing style in Node.js and elsewhere, and so there exist tools to transform them (syntactically or otherwise) into more palpable styles:https://github.com/0ctave/node-sync https://github.com/BYVoid/continuation https://github.com/JeffreyZhao/wind https://github.com/Sage/streamlinejs−joshguthrie13yI already knew about node-sync, but continuation really brings something new. I'll check the source to understand what it does under the hood.−j_s13yAlso, the comparison on the project's README is informative (and lists additional options):https://github.com/BYVoid/continuation#relevant-projects−craigyk13yI agree, I often will write promise wrappers for other people's stuff, but for the external surface of my module I have callbacks.Also, callbacks ARE sometimes nicer than promises, etc... especially if you have CoffeeScript function syntax.
Comments
https://github.com/0ctave/node-sync https://github.com/BYVoid/continuation https://github.com/JeffreyZhao/wind https://github.com/Sage/streamlinejs
I already knew about node-sync, but continuation really brings something new. I'll check the source to understand what it does under the hood.
Also, the comparison on the project's README is informative (and lists additional options):
https://github.com/BYVoid/continuation#relevant-projects
I agree, I often will write promise wrappers for other people's stuff, but for the external surface of my module I have callbacks.
Also, callbacks ARE sometimes nicer than promises, etc... especially if you have CoffeeScript function syntax.