{"id":20838779,"url":"https://github.com/royalicing/scalemodel","last_synced_at":"2026-04-22T15:34:56.454Z","repository":{"id":54382666,"uuid":"339905261","full_name":"RoyalIcing/scalemodel","owner":"RoyalIcing","description":"Replicate a generator function’s code","archived":false,"fork":false,"pushed_at":"2021-02-22T06:49:55.000Z","size":93,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-18T23:43:02.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://regenerated.dev/","language":"TypeScript","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/RoyalIcing.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":"2021-02-18T01:43:46.000Z","updated_at":"2022-10-24T04:18:07.000Z","dependencies_parsed_at":"2022-08-13T14:00:51.377Z","dependency_job_id":null,"html_url":"https://github.com/RoyalIcing/scalemodel","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/RoyalIcing%2Fscalemodel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fscalemodel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fscalemodel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fscalemodel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyalIcing","download_url":"https://codeload.github.com/RoyalIcing/scalemodel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196662,"owners_count":20251861,"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-11-18T01:11:31.774Z","updated_at":"2025-12-24T15:57:36.192Z","avatar_url":"https://github.com/RoyalIcing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e🧍🏼‍♂️🚂🧍🏾‍♀️ Scale Model\u003c/h1\u003e\n  \u003cp\u003eReplicate a generator function’s code\u003c/p\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=scalemodel\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/minzip/scalemodel@0.1.0\" alt=\"minified and gzipped size\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/min/scalemodel@0.1.0\" alt=\"minified size\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/dependency-count/scalemodel@0.1.0\" alt=\"zero dependencies\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Install\n\n```console\nnpm add scalemodel\n```\n\n## Examples\n\n```javascript\nimport { toCode } from \"scalemodel\";\n\nfunction* Outer() {\n  yield Inner;\n}\n\nfunction* Inner() {\n  yield [\"first\", 1];\n  yield [2, \"second\"];\n  yield [3, \"third\", 3];\n}\n\nconst jsCode = toCode(Outer);\n\n/*\n\"function* Outer() {\n\\tyield Inner;\n}\n\nfunction* Inner() {\n\\tyield [\"first\",1];\n\\tyield [2,\"second\"];\n\\tyield [3,\"third\",3];\n}\"\n*/\n```\n\n## TODO\n\n- Regular expressions?\n- Sets?\n- Maps?\n- Symbols?\n- Minify?\n- Web worker support!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fscalemodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyalicing%2Fscalemodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fscalemodel/lists"}