How to use the filterSeries function from async
Find comprehensive JavaScript async.filterSeries code examples handpicked from public code repositorys.
GitHub: thinktecture/sinopia
147 148 149 150 151 152 153 154 155 156
app.get('/-/search/:term?', function (req, res) { var searchTerm = req.params.term; storage.get_local(function(err, packages) { if (err) throw err // that function shouldn't produce any async.filterSeries(packages, function(package, cb) { auth.allow_access(package.name, req.remote_user, function(err, allowed) { setImmediate(function () { if (searchTerm) { cb(!err && allowed && package.name.indexOf(searchTerm) !== -1);
684
0
4
45 46 47 48 49 50 51 52 53 54
this.invalidInputFiles = 0; } async validateInputFiles() { const originalLength = this.inputFiles.length; this.inputFiles = await async.filterSeries(this.inputFiles, async (i) => { return (null, await fs.pathExists(i)); }); if (this.inputFiles.length !== originalLength) { this.invalidInputFiles = originalLength - this.inputFiles.length; if (this.verbose) console.log(`${this.invalidInputFiles} file${this.invalidInputFiles === 1 ? '' : 's'} will be skipped because ${this.invalidInputFiles === 1 ? 'it does' : 'they do'} not exist`); }
18
153
3
3 4 5 6 7 8 9 10 11 12
* This helper runs actions of all the Handlers that the react-router * has said are active. This pre-populates the context with all the data * needed to render components. */ module.exports = function(state, context, done) { async.filterSeries( state.routes.filter(function(route) { // TODO: handler.loadAction is not present using ProxyView return route.handler.loadAction?true:false; }),
4
20
2
176 177 178 179 180 181 182 183 184 185
}) }) } async filterSeries(coll, iteratee) { return new Promise(async (resolve, reject) => { async.filterSeries(coll, iteratee, (err, res) => { if (err) { reject(err) } else { resolve(res)
1
0
1
+ 21 other calls in file
GitHub: Souler/I-Wanna-Watch
87 88 89 90 91 92 93 94 95
// If the script is being run directly we need to initialize if (!module.parent) asyncFns.push(init); var filesFilter = function (_cb) { async.filterSeries(strmFiles, checkSTRMFile, function (results) { _cb(null, results); }); };
0
3
2
GitHub: gvaldambrini/madam
166 167 168 169 170 171 172 173 174 175
if (value === 'n' || value === 'no') return 'no'; throw new Error('Enter yes or no.'); }; async.filterSeries(res.documents, function(doc, filterCallback) { if (!documentExists(doc)) { filterCallback(true); return; }
0
1
1
GitHub: CodeNow/docklet
15 16 17 18 19 20 21 22 23 24
function filter (err, containers) { if (err) { throw err; } console.log('LIST', containers.map(id)); async.filterSeries(containers, top, applyHolyWater) } function id (container) { return container.Id;
0
0
6
async.parallel is the most popular function in async (1226 examples)