How to use the filterLimit function from async
Find comprehensive JavaScript async.filterLimit code examples handpicked from public code repositorys.
GitHub: r-hub/sysreqs.app
13 14 15 16 17 18 19 20 21 22
var url = urls.crandb + '/-/sysreqs'; got(url, function(err, data) { if (err) { return console.log(err); } var sys = JSON.parse(data); var keys = Object.keys(sys); async.filterLimit( keys, 10, function(item, callback) { if (item.indexOf('-') > -1) { return callback(false); }
3
3
3
165 166 167 168 169 170 171 172 173 174
}) }) } async filterLimit(coll, limit, iteratee) { return new Promise(async (resolve, reject) => { async.filterLimit(coll, limit, iteratee, (err, res) => { if (err) { reject(err) } else { resolve(res)
1
0
1
+ 21 other calls in file
GitHub: Liksu/any-fixtures
50 51 52 53 54 55 56 57 58 59
accept.forEach(fill.bind(null, folder, req.method.toLowerCase())); accept.forEach(fill.bind(null, folder, 'any')); }); var result = null; async.filterLimit(files, 1, fs.exists, function(results) { if (results.length) { fs.readFile(results[0], function(error, data) { result = { content: data.toString(),
0
3
4
GitHub: iam-frankqiu/docs
31 32 33 34 35 36 37 38 39 40
localizedPath: path.join(basePath, page.relativePath), languageCode: language.code })) }) .flat() localizedPaths = await filterLimit( localizedPaths, FILE_READ_LIMIT, async ({ localizedPath }) => Page.exists(localizedPath) )
0
2
1
19 20 21 22 23 24 25 26 27 28
} catch (err) { console.error(err); } }); // let badVideos = await async.filterLimit(videosWithUpload, 2, async (video) => { // console.log(video.id); // try { // let response = await request({ method: 'HEAD', uri: video.originalUpload.S3Url() }) // return response['content-length'] === '0'
0
0
2
async.parallel is the most popular function in async (1226 examples)