How to use the each function from bluebird
Find comprehensive JavaScript bluebird.each code examples handpicked from public code repositorys.
34 35 36 37 38 39 40 41 42 43
exec: function exec(commands) { var _this = this; var stdout = ''; var stderr = ''; return Bluebird.each(commands, function(command) { return _this._connection.execAsync(command) .then(function(stream) { var localStdout = ''; var localStderr = '';
8
6
2
+ 3 other calls in file
GitHub: republik/plattform
220 221 222 223 224 225 226 227 228 229
if (!previousPaths.length) { return } await Promise.each([...new Set(previousPaths)], (previousPath) => { debug('upsertRedirection', { source: previousPath, target: newPath, repoId,
7
40
1
+ 5 other calls in file
GitHub: kclay/leaguebot
119 120 121 122 123 124 125 126 127 128
teamsByName[team.name.toLowerCase()] = team; }); await Promise.each(weeks, async (week) => { let games = week.map(game => { return { home_team_id: teamsByName[game.Home].id,
1
3
0
835 836 837 838 839 840 841 842 843 844
twice(function () { var trans = ins.startTransaction() var arr = [resolved(1), resolved(2), resolved(3)] var results = [1, 2, 3] Promise.each(arr, function (item, index, length) { var expected = results.shift() t.strictEqual(item, expected) t.strictEqual(index, expected - 1, 'index should be expected - 1') t.strictEqual(length, 3, 'length should be 3')
1
0
1
+ 2 other calls in file
216 217 218 219 220 221 222 223 224
* @param {string} kind see {File#load} * @param {BlobStore} blobStore * @return {Promise} */ loadFiles(kind, blobStore) { return BPromise.each(this.operations, operation => operation.loadFiles(kind, blobStore) ) }
0
2
1
+ 5 other calls in file
951 952 953 954 955 956 957 958 959 960 961 962 963
function execHooks(schema, type, event, data) { const hooks = schema.hooks[type][event]; if (!hooks.length) return Promise.resolve(data); return Promise.each(hooks, hook => hook(data)).thenReturn(data); } Model.prototype.size = Model.prototype.count;
0
0
1
+ 9 other calls in file
87 88 89 90 91 92 93 94 95 96
const rows = results.data.map(dataPoint => { return _rowForDataPoint({ results, dataPoint }) }) const rowsToInsert = [] return Promise.each(rows, row => { return _queryForExistingRow({ db, row }).then(results => { if (row.date === undefined) { return } else if (results.length === 0) {
0
0
1
+ 25 other calls in file
253 254 255 256 257 258 259 260 261 262
} }); fsMock._statMock.isDirectory.mockReturnValue(false); module.compileStats = stats; return BbPromise.each(['1.18.1', '2.17.0', '10.15.3'], (version) => { getVersionStub.mockReturnValue(version); return expect(module.packageModules()) .resolves.toEqual([path.join('.rspack', 'test-service.zip')]) .then(() => BbPromise.all([]));
0
0
0
+ 3 other calls in file
GitHub: c-calvin/tanghexinbl
222 223 224 225 226 227 228 229 230 231
require('../plugins/processor')(this); require('../plugins/renderer')(this); require('../plugins/tag')(this); // Load config return Promise.each([ 'update_package', // Update package.json 'load_config', // Load config 'load_plugins' // Load external plugins & scripts ], name => require(`./${name}`)(this)).then(() => this.execFilter('after_init', null, {context: this})).then(() => {
0
0
1
+ 3 other calls in file
81 82 83 84 85 86 87 88 89 90
if (!this.debugCommand) { // generate iterator const iterator = [] for (let i = 0; i < ffmpegCommands.length; i++) iterator.push(i) await Bluebird.each(iterator, async (i: number) => { await this.execAsync('ffmpeg', ffmpegCommands[i]) await this.execAsync('exiftool', exifCommands[i]) }) }
0
0
2
+ 13 other calls in file
bluebird.reject is the most popular function in bluebird (2988 examples)