{"id":23252622,"url":"https://github.com/biyuehu/fluoro","last_synced_at":"2026-02-15T15:03:12.074Z","repository":{"id":242315513,"uuid":"809239417","full_name":"BIYUEHU/fluoro","owner":"BIYUEHU","description":"A Meta-Framework base on AOP and IoC","archived":false,"fork":false,"pushed_at":"2025-01-21T10:37:40.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T10:34:34.826Z","etag":null,"topics":["aop","aspect-oriented-programming","control-inversion","dependency-injection","framework","metaframework","modern","typescript","universal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BIYUEHU.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T05:43:55.000Z","updated_at":"2025-01-21T10:37:43.000Z","dependencies_parsed_at":"2024-06-02T07:23:37.201Z","dependency_job_id":"b240871c-1a19-4434-8c05-ce087130a577","html_url":"https://github.com/BIYUEHU/fluoro","commit_stats":null,"previous_names":["biyuehu/fluoro"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BIYUEHU/fluoro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Ffluoro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Ffluoro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Ffluoro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Ffluoro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BIYUEHU","download_url":"https://codeload.github.com/BIYUEHU/fluoro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BIYUEHU%2Ffluoro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29481924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aop","aspect-oriented-programming","control-inversion","dependency-injection","framework","metaframework","modern","typescript","universal"],"created_at":"2024-12-19T10:17:25.269Z","updated_at":"2026-02-15T15:03:12.032Z","avatar_url":"https://github.com/BIYUEHU.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://kotori.js.org/fluoro.png\" width=\"200px\" height=\"200px\" alt=\"logo\"/\u003e\n\n# Fluoro\n\n⚡ A modern and universal Meta-Framework to construct other frameworks. ⚡\n\n\u003c/div\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\nIt refers to thoughts which are Aspect-Oriented Programming, Inversion of Control and Dependency Injection.\n\n## ❓ Why is `Fluoro`?\n\n**Fluoro**, its original word is `Fluorine` (F₂), it is the strongest monatomic oxidant in nature, except for some inert gases, it can react with almost all elements, and its compounds are extremely rich and diverse and have stability. Take this name, hoping Fluoro has strong ability, thus build various diversified frameworks and provide strong underlying support.\n\n## 🛠️ Class \u0026 Interface\n\n- Context\n- Events\n- Modules\n- Services\n- Tokens\n\n## 🧊 Usage\n\n### Provide, get \u0026 mixin, inject\n\n```typescript\ndeclare class Server {}\n\ndeclare interface Context {\n  config: typeof config;\n  display: (typeof demo)[\"display\"];\n}\n\nconst demo = {\n  name: \"hello, kotori!\",\n  display() {\n    return this.name;\n  },\n};\n\nconst ctx = new Context();\n\nctx.provide(\"config\", {\n  port: 3000,\n  host: \"localhost\",\n});\nctx.provide(\"server\", new Server());\n\nconst config = ctx.get(\"config\"); // { port: 3000 }\nconst server = ctx.get(\"server\"); // Server {}\n\nctx.config.port; // TypeError: Cannot read properties of undefined (reading 'port')\nctx.inject(\"config\");\nctx.config.port; // 3000\n\nctx.display(); // Uncaught TypeError: ctx.display is not a function\nctx.mixin(\"demo\", [\"display\"]);\nctx.display(); // hello, kotori!\n```\n\n### Extends\n\n```typescript\nconst ctx = new Context();\nconst ctxChild1 = ctx.extends();\nconst ctxChild2 = ctx.extends();\n\nctx.provide('data1', { value: 1 });\nctx.inject('data1');\nctx.data1.value; // 1\nctxChild1.data1.value; // 1\n\nctxChild1.provide('data2', { value: 2 });\nctxChild1.inject('data2');\nctx.data2; // undefined\nctxChild1.data2.value; // 2\n\nctxChild2.provide('data3', { value: 3 });\nctxChild2.inject('data3');\nctx.data3; // undefined\nctxChild1.data3; // undefined\nctxChild2.data3.value; // 3\n\nconst ctx = new Context();\nconst ctxChild1 = ctx.extends();\nconst ctxChild2 = ctx.extends({meta: 'some meta data', 'child2'});\n\nctx.meta; // undefined\nctxChild1.meta; // undefined\nctxChild2.meta; //'some meta data'\n\nctx.identity; // undefined\nctxChild1.identity; // 'sub'\nctxChild2.identity; // 'child2'\n\n```\n\n### Modules\n\n```typescript\n/* types */\ntype ModuleInstanceClass = new (ctx: Context, config: ModuleConfig) =\u003e void;\ntype ModuleInstanceFunction = (ctx: Context, config: ModuleConfig) =\u003e void;\n\ninterface ModuleExport {\n  name?: string;\n  main?: ModuleInstanceFunction;\n  Main?: ModuleInstanceClass;\n  default?: ModuleInstanceFunction | ModuleInstanceClass;\n  inject?: string[];\n  config?: ModuleConfig;\n}\n\ninterface EventDataModule {\n  instance: ModuleExport | string | ModuleInstanceFunction | ModuleInstanceClass;\n}\n\n/* index.ts */\nfunction plugin1(ctx: Context) {\n  ctx.logger.debug('plugin1 loaded');\n}\n\nexport function main(ctx: Context) {\n  // output: module(main plugin) loaded\n  ctx.on('read_module', (data: EventDataModule) =\u003e {\n    if (data.instance === main) ctx.logger.debug('module(main plugin) loaded');\n    else if (data.instance === plugin1) ctx.logger.debug('plugin1(sub plugin) loaded');\n  });\n  ctx.load(plugin1); // output: plugin1(sub plugin) loaded\n}\n\nexport const config = Tsu.Object({\n  value: Tsu.String()\n});\n\n// Others\n\nexport function main(ctx: Context, cfg: Tsu.infer\u003ctypeof config\u003e) {\n  ctx.logger.debug(ctx.identity, cfg.value); // my-project here is a string\n  const subCfg = {\n    value: 233\n  }\n  ctx.load({\n    name: 'plugin1',\n    main: (subCtx: Context, cfg: typeof 233) =\u003e {\n      subCtx.logger.debug(subCtx.identity, cfg.value); // plugin1 233\n    }\n  });\n}\n```\n\n## 📜 Applications\n\n**Kotori Bot** is a crossing-platform chatbot framework,its core (`@kotori-bot/core`) depends on Fluoro,\nand is a fine reference to help you build your own framework.\n\n- [Kotori Docs](https://kotori.js.org/)\n\n**Misakura** is a galgame(Visual novel games) made framework based on tauri, PIXI.js (solid.js) and Fluoro.\n\n- [Misakura Docs](https://misakura.js.org/)\n\n\u003e Welcome you to join us!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyuehu%2Ffluoro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiyuehu%2Ffluoro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiyuehu%2Ffluoro/lists"}