Oracle Magazine, Nov/Dec 2017
Database Developer OPEN SOURCE Keep Your Node js Promises Heres Part 3 in a four part series on asynchronous Node js development In the previous article in this series Using the Callback Pattern and the Async Module I covered using Node js style callbacks and the third party Async module to execute a SQL query While those patterns are effective they are not the only ways of writing asynchronous code with Node js The Promise object which became available with Node js v012 provides a native means of reasoning about the success or failure of asynchronous operations Its important to learn about promise objects promises because many modules use them in their APIs Also they are integral to asynchronous functions which Ill cover in the next part of this series This article will cover the basics of promises and demonstrate how to use them to construct asynchronous applications The last section Executing a Query with Promises will show how to use promises to execute a SQL query ORACLE MAGAZINE NOVEMBER OCTOBER 2017 46 By Dan McGhan
You must have JavaScript enabled to view digital editions.