arnaucube
arnaucube/raspberryGPIOhtmlserverPublic Self-hosted repository
raspberryGPIOhtmlserver/node_modules/after/README.md
node_modules/after/README.mdRaw
 1# After [![Build Status][1]][2]
 2
 3Invoke callback after n calls
 4
 5## Status: production ready
 6
 7## Example
 8
 9    var after = require("after")
10        , next = after(3, logItWorks)
11
12    next()
13    next()
14    next() // it works
15
16    function logItWorks() {
17        console.log("it works!")
18    }
19
20## Example with error handling
21
22    var after = require("after")
23        , next = after(3, logError)
24
25    next()
26    next(new Error("oops")) // logs oops
27    next() // does nothing
28
29    function logError(err) {
30        console.log(err)
31    }
32
33## After < 0.6.0
34
35Older versions of after had iterators and flows in them.
36
37These have been replaced with seperate modules
38
39 - [iterators][8]
40 - [composite][9]
41
42## Installation
43
44`npm install after`
45
46## Tests
47
48`npm test`
49
50## Blog post
51
52 - [Flow control in node.js][3]
53
54## Examples :
55
56 - [Determining the end of asynchronous operations][4]
57 - [In javascript what are best practices for executing multiple asynchronous functions][5]
58 - [JavaScript performance long running tasks][6]
59 - [Synchronous database queries with node.js][7]
60
61## Contributors
62
63 - Raynos
64
65## MIT Licenced
66
67  [1]: https://secure.travis-ci.org/Raynos/after.png
68  [2]: http://travis-ci.org/Raynos/after
69  [3]: http://raynos.org/blog/2/Flow-control-in-node.js
70  [4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
71  [5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
72  [6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
73  [7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
74  [8]: http://github.com/Raynos/iterators
75  [9]: http://github.com/Raynos/composite