Files: 7aa21412f6c0bd6b84022d67ff8e51711eddb510 / count.js
202 bytesRaw
1 | module.exports = function count (max) { |
2 | var i = 0; max = max || Infinity |
3 | return function (end, cb) { |
4 | if(end) return cb && cb(end) |
5 | if(i > max) |
6 | return cb(true) |
7 | cb(null, i++) |
8 | } |
9 | } |
10 | |
11 | |
12 |
Built with git-ssb-web