{"id":15816544,"url":"https://github.com/cachecontrol/promise-every-series","last_synced_at":"2025-10-26T16:37:27.048Z","repository":{"id":29502349,"uuid":"33040309","full_name":"CacheControl/promise-every-series","owner":"CacheControl","description":"Execute promises in series, testing that each result satisfies a condition.","archived":false,"fork":false,"pushed_at":"2015-10-26T00:24:02.000Z","size":154,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T14:51:07.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CacheControl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T16:18:04.000Z","updated_at":"2015-04-18T14:55:16.000Z","dependencies_parsed_at":"2022-08-23T14:00:52.207Z","dependency_job_id":null,"html_url":"https://github.com/CacheControl/promise-every-series","commit_stats":null,"previous_names":["cdhamm/promise-every-series"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CacheControl%2Fpromise-every-series","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CacheControl%2Fpromise-every-series/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CacheControl%2Fpromise-every-series/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CacheControl%2Fpromise-every-series/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CacheControl","download_url":"https://codeload.github.com/CacheControl/promise-every-series/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246580461,"owners_count":20800108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T05:05:09.279Z","updated_at":"2025-10-26T16:37:22.004Z","avatar_url":"https://github.com/CacheControl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promise Every Series\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)\n\nGiven an array of methods that return promises, execute in series and return true if all satisfy a test.\n\nThis library is useful when having a set of prioritized promises to check, and you'd like to test the fast(cheap) calls first, short circuiting if they fail the test.\n\nFor example, if you needed to check several conditions, involving synchronous code(fast), local database calls(less fast), and third party services(slow), you'd want to execute the fast one first, followed by the slower ones, and so forth, stopping immediately if any fail the test.\n\n## Installation\n```$ npm install promise-every-series```\n\n## Basic Usage\n\n```javascript\nvar everySeries = require('promise-every-series');\n\nvar superFast = function() {\n  return new Promise(function(resolve, reject) {\n    console.log('superFast ran!');\n    resolve(true);\n  });\n};\n\nvar sortaSlow = function() {\n  return new Promise(function(resolve, reject) {\n    console.log('sortaSlow ran!');\n    resolve(false);\n  });\n};\n\nvar superDuperSlow = function() {\n  return new Promise(function(resolve, reject) {\n    console.log('superDuperSlow ran!');\n    resolve(true);\n  });\n};\n\neverySeries([superFast, sortaSlow, superDuperSlow], function(res) {\n  return res === true; //only promises that resolve(true) pass the test\n}).then( (result) =\u003e {\n  console.log(result);\n});\n```\nThis will print:\n```javascript\nsuperFast ran!\nsortaSlow ran!\nfalse  //note that superDuperSlow did not run\n```\n\n## Inputs\nEmpty arrays or failing to provide a valid callback immediately resolve as false.\n```javascript\neverySeries([]).then( (data) =\u003e {\n  console.log(results); //false\n});\n```\nThis will print:\n```javascript\nfalse\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachecontrol%2Fpromise-every-series","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcachecontrol%2Fpromise-every-series","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachecontrol%2Fpromise-every-series/lists"}