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.