A JavaScript compiler that transforms functions annotated with @async JSDoc tag into code using Promises for sequential asynchronous execution. Version 1.0.20 is the current stable release, with no recent updates indicating ongoing maintenance. It provides a simpler alternative to nested callbacks or promise chains by allowing developers to write asynchronous code in a synchronous style. Unlike native async/await (ES2017), it requires a compile step and a runtime library (async-compiler-runtime), and does not support advanced features like error handling or parallel execution patterns.
npm install async-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a complete example: two async functions, a function with @async tag that composes them, and the compile/run commands.
Use node --harmony or update Node.js to version 6+ where destructuring is enabled by default (though --harmony still recommended).
Migrate to native async/await syntax and remove the compile step.
Ensure JSDoc comment starts with /** and ends with */, with @async inside.
Install async-compiler-runtime: npm install async-compiler-runtime (or include as dependency). Then add `var AsyncTool = require('async-compiler-runtime');` at the top of your source file before using @async functions.Run with --harmony flag: node --harmony compiled.js
Ensure that inside @async functions, all asynchronous calls return Promises (e.g., using the provided add/mul functions). The final return value of the @async function must be a Promise (typically the result of the outermost async call).