Kaffeine
Kaffeine is a precompiler that touts itself as âExtended JavaScript.â[64] Among other features, the language offers a simple syntactic sugar for un-nesting callbacks: just add ! after an async functionâs name. Kaffeine assumes that the function takes a callback as its last argument and simply transforms all code after that call into the callback.
For example, in a jQuery application, itâs common to want everything to run from within a $ callback (after the document is ready). With Kaffeine, thatâs easily done.
â | $!() |
â | alert(â'The document is ready.'â); |
Although it doesnât have as big a following as CoffeeScript, features like this make Kaffeine well worth checking out. The CoffeeScript forks Coco and LiveScript ...
Get Async JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.