Sha256: 5c61b9cb281766da685a86a1006a2aebefaeeab211d02c5a28dab58c1670290a

Contents?: true

Size: 1.42 KB

Versions: 48

Compression:

Stored size: 1.42 KB

Contents

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _timesLimit = require('./timesLimit');

var _timesLimit2 = _interopRequireDefault(_timesLimit);

var _doLimit = require('./internal/doLimit');

var _doLimit2 = _interopRequireDefault(_doLimit);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Calls the `iteratee` function `n` times, and accumulates results in the same
 * manner you would use with [map]{@link module:Collections.map}.
 *
 * @name times
 * @static
 * @memberOf module:ControlFlow
 * @method
 * @see [async.map]{@link module:Collections.map}
 * @category Control Flow
 * @param {number} n - The number of times to run the function.
 * @param {AsyncFunction} iteratee - The async function to call `n` times.
 * Invoked with the iteration index and a callback: (n, next).
 * @param {Function} callback - see {@link module:Collections.map}.
 * @example
 *
 * // Pretend this is some complicated async factory
 * var createUser = function(id, callback) {
 *     callback(null, {
 *         id: 'user' + id
 *     });
 * };
 *
 * // generate 5 users
 * async.times(5, function(n, next) {
 *     createUser(n, function(err, user) {
 *         next(err, user);
 *     });
 * }, function(err, users) {
 *     // we should now have 5 users
 * });
 */
exports.default = (0, _doLimit2.default)(_timesLimit2.default, Infinity);
module.exports = exports['default'];

Version data entries

48 entries across 46 versions & 11 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/async/times.js
disco_app-0.18.0 test/dummy/node_modules/async/times.js
disco_app-0.18.2 test/dummy/node_modules/async/times.js
disco_app-0.16.1 test/dummy/node_modules/async/times.js
disco_app-0.15.2 test/dummy/node_modules/async/times.js
disco_app-0.18.4 test/dummy/node_modules/async/times.js
disco_app-0.18.1 test/dummy/node_modules/async/times.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/async/times.js
disco_app-0.14.0 test/dummy/node_modules/async/times.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/async/times.js
tang-0.2.1 spec/tang_app/node_modules/async/times.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/async/times.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/async/times.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/async/times.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/async/times.js
tang-0.2.0 spec/tang_app/node_modules/async/times.js
tang-0.1.0 spec/tang_app/node_modules/async/times.js
tang-0.0.9 spec/tang_app/node_modules/async/times.js
enju_library-0.3.8 spec/dummy/node_modules/async/times.js
ilog-0.4.1 node_modules/async/times.js