{"id":18890995,"url":"https://github.com/iso50/step-by-step","last_synced_at":"2025-10-30T02:20:28.632Z","repository":{"id":17673749,"uuid":"82453609","full_name":"ISO50/step-by-step","owner":"ISO50","description":"Tiny tooling to execute Promises in a synchronous manner","archived":false,"fork":false,"pushed_at":"2022-04-09T02:02:12.000Z","size":141,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T06:22:42.687Z","etag":null,"topics":["array","async","asynchronous","es6","javascript","library","promise","synchronous"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ISO50.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-19T11:17:23.000Z","updated_at":"2021-02-02T18:12:01.000Z","dependencies_parsed_at":"2022-08-07T09:00:10.101Z","dependency_job_id":null,"html_url":"https://github.com/ISO50/step-by-step","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISO50%2Fstep-by-step","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISO50%2Fstep-by-step/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISO50%2Fstep-by-step/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISO50%2Fstep-by-step/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ISO50","download_url":"https://codeload.github.com/ISO50/step-by-step/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239867382,"owners_count":19710352,"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":["array","async","asynchronous","es6","javascript","library","promise","synchronous"],"created_at":"2024-11-08T07:58:28.288Z","updated_at":"2025-10-30T02:20:23.595Z","avatar_url":"https://github.com/ISO50.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# step-by-step\n\nA simple way to execute a group of ES6 promises in a synchronous manner.\n\n\n## How to use\n\nIn this example a synthetic `Promise` is used to show how `runSync` works.\nThe input array for runSync should contain functions which return the Promises that will be executed in a synchronous way.\n\n```javascript\nconst runSync = require('step-by-step').runSync;\n\nconst createPromise = (param) =\u003e {\n  return () =\u003e {\n    return new Promise(resolve =\u003e {\n\n      const [planet, stopFor] = param;\n\n      setTimeout(() =\u003e {\n        console.log(planet);\n        resolve(planet);\n      }, stopFor);\n    });\n  };\n};\n\nconst promiseArray = [\n  createPromise(['Mercury', 220]),\n  createPromise(['Venus', 100]),\n  createPromise(['Earth', 1]),\n  createPromise(['Mars', 150])\n];\n\n// Output: Mercury, Venus, Earth, Mars\nconst results = runSync(promiseArray);\n\n// Output: [ 'Mercury', 'Venus', 'Earth', 'Mars' ]\nresults.then(console.log);\n```\n\nLooks a bit bulky? If all the promise factory related stuff is left out it looks way cleaner:\n\n```javascript\nconst runSync = require('step-by-step').runSync;\n\nconst promises = [\n  () =\u003e fetch('http://a'),\n  () =\u003e fetch('http://b'),\n  () =\u003e fetch('http://c')\n];\n\nrunSync(promises);\n```\n\n## Changelog\n\n* `1.0.8` - updated dev dependencies\n* `1.0.6` - changed typings\n* `1.0.4` - fix wrong export 😀\n* `1.0.2` - add typings see #1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiso50%2Fstep-by-step","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiso50%2Fstep-by-step","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiso50%2Fstep-by-step/lists"}