{"id":15363148,"url":"https://github.com/techquery/onion-stack","last_synced_at":"2026-01-21T07:26:02.826Z","repository":{"id":57314759,"uuid":"173771002","full_name":"TechQuery/onion-stack","owner":"TechQuery","description":"Middleware framework based on Async Generator of ECMAScript 2018, inspired by Koa 2","archived":false,"fork":false,"pushed_at":"2024-09-02T19:13:23.000Z","size":180,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T18:50:57.586Z","etag":null,"topics":["async-generator","ecmascript","koa","middleware"],"latest_commit_sha":null,"homepage":"https://tech-query.me/onion-stack/","language":"TypeScript","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/TechQuery.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-04T15:29:35.000Z","updated_at":"2024-09-02T19:11:46.000Z","dependencies_parsed_at":"2025-01-18T23:26:35.402Z","dependency_job_id":"8a18da82-2d8c-4800-8723-8d039ae38566","html_url":"https://github.com/TechQuery/onion-stack","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"0497d47a69066392659cfdaa81602b7b3ee94ea5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fonion-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fonion-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fonion-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fonion-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechQuery","download_url":"https://codeload.github.com/TechQuery/onion-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249041589,"owners_count":21203127,"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":["async-generator","ecmascript","koa","middleware"],"created_at":"2024-10-01T13:04:55.273Z","updated_at":"2026-01-21T07:26:02.790Z","avatar_url":"https://github.com/TechQuery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OnionStack\n\n**Middleware** framework based on [Async Generator][1] \u0026 [TypeScript][2], inspired by [Koa 2][3].\n\n[![NPM Dependency](https://img.shields.io/librariesio/github/TechQuery/onion-stack.svg)][4]\n[![CI \u0026 CD](https://github.com/TechQuery/onion-stack/actions/workflows/main.yml/badge.svg)][5]\n[![](https://data.jsdelivr.com/v1/package/npm/onion-stack/badge?style=rounded)][6]\n\n[![NPM](https://nodei.co/npm/onion-stack.png?downloads=true\u0026downloadRank=true\u0026stars=true)][7]\n\n## Example\n\n```javascript\nimport OnionStack from 'onion-stack';\n\nconst list = [];\n\nconst stack = new OnionStack(\n    function* () {\n        list.push(1);\n\n        yield;\n\n        list.push(2);\n\n        yield;\n\n        list.push(3);\n    },\n    async function* () {\n        await delay(0.1);\n\n        list.push(4);\n\n        yield;\n\n        list.push(5);\n    },\n    function () {\n        list.push(6);\n    }\n);\n\nstack.execute().then(() =\u003e console.log(list)); //  [1, 4, 6, 5, 2]\n```\n\n[More cases](https://github.com/TechQuery/onion-stack/tree/master/test)\n\n[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of#Iterating_over_async_generators\n[2]: https://www.typescriptlang.org\n[3]: https://koajs.com\n[4]: https://libraries.io/npm/onion-stack\n[5]: https://github.com/TechQuery/onion-stack/actions/workflows/main.yml\n[6]: https://www.jsdelivr.com/package/npm/onion-stack\n[7]: https://nodei.co/npm/onion-stack/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechquery%2Fonion-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechquery%2Fonion-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechquery%2Fonion-stack/lists"}