Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/p-each-series/ |
Upload File : |
# p-each-series [](https://travis-ci.org/sindresorhus/p-each-series) > Iterate over promises serially Useful as a side-effect iterator. Prefer [`p-map`](https://github.com/sindresorhus/p-map) if you don't need side-effects, as it's concurrent. ## Install ``` $ npm install --save p-each-series ``` ## Usage ```js const pEachSeries = require('p-each-series'); const keywords = [ getTopKeyword() //=> Promise 'rainbow', 'pony' ]; const iterator = el => saveToDiskPromise(el); //=> Promise pEachSeries(keywords, iterator).then(result => { console.log(result); //=> ['unicorn', 'rainbow', 'pony'] }); ``` ## API ### pEachSeries(input, iterator) Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `iterator` are fulfilled, or rejects if any of the promises reject. The fulfillment value is the original `input`. #### input Type: `Iterable<Promise|any>` Iterated over serially in the `iterator` function. #### iterator(element, index) Type: `Function` Return value is ignored unless it's `Promise`, then it's awaited before continuing with the next iteration. ## Related - [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially - [p-pipe](https://github.com/sindresorhus/p-pipe) - Compose promise-returning & async functions into a reusable pipeline - [p-reduce](https://github.com/sindresorhus/p-reduce) - Reduce a list of values using promises into a promise for a value - [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently - [More…](https://github.com/sindresorhus/promise-fun) ## License MIT © [Sindre Sorhus](https://sindresorhus.com)