Fix license issues
[sdnc/oam.git] / dgbuilder / dgeflows / node_modules / serve-index / node_modules / batch / Readme.md
1
2 # batch
3
4   Simple async batch with concurrency control and progress reporting.
5
6 ## Installation
7
8 ```
9 $ npm install batch
10 ```
11
12 ## API
13
14 ```js
15 var Batch = require('batch')
16   , batch = new Batch;
17
18 batch.concurrency(4);
19
20 ids.forEach(function(id){
21   batch.push(function(done){
22     User.get(id, done);
23   });
24 });
25
26 batch.on('progress', function(e){
27
28 });
29
30 batch.end(function(err, users){
31
32 });
33 ```
34
35 ### Progress events
36
37   Contain the "job" index, response value, duration information, and completion data.
38
39 ```js
40 { index: 1,
41   value: 'bar',
42   pending: 2,
43   total: 3,
44   complete: 2,
45   percent: 66,
46   start: Thu Oct 04 2012 12:25:53 GMT-0700 (PDT),
47   end: Thu Oct 04 2012 12:25:53 GMT-0700 (PDT),
48   duration: 0 }
49 ```
50
51 ## License
52
53 (The MIT License)
54
55 Copyright (c) 2013 TJ Holowaychuk <tj@vision-media.ca>
56
57 Permission is hereby granted, free of charge, to any person obtaining
58 a copy of this software and associated documentation files (the
59 'Software'), to deal in the Software without restriction, including
60 without limitation the rights to use, copy, modify, merge, publish,
61 distribute, sublicense, and/or sell copies of the Software, and to
62 permit persons to whom the Software is furnished to do so, subject to
63 the following conditions:
64
65 The above copyright notice and this permission notice shall be
66 included in all copies or substantial portions of the Software.
67
68 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
69 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
70 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
71 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
72 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
73 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
74 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.