Patterns for node.js.
Code previews use the same variable names as assigned in previous code previews. For example, seriesPattern is bound to seriesP, and is later called from that.
-
Download it using your tool of choice
- yarn:
yarn add node-paternal
- npm:
npm install node-paternal
- yarn:
-
Include it in your project
const paternal = require('node-paternal') const seriesP = paternal.seriesPattern
Right now there is only series pattern.
Run a set of functions in order, with a final callback. Each function must call it's callback to continue the series. The callbacks they call are provided by seriesPattern
let functions = []
/* add a bunch of functions, in the form function(callback) */
let cb = function() { /* code */ }
seriesP(functions, cb)