{"id":28195717,"url":"https://github.com/nmnmcc/litro","last_synced_at":"2026-04-18T04:33:28.148Z","repository":{"id":239318665,"uuid":"797546640","full_name":"NMNMCC/litro","owner":"NMNMCC","description":"A simple router for lit.","archived":false,"fork":false,"pushed_at":"2024-05-25T14:29:09.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T12:29:33.917Z","etag":null,"topics":["easy-to-use","javascript","library","lit","lit-element","lit-html","npm","router","tit","typescript","web-components"],"latest_commit_sha":null,"homepage":"","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/NMNMCC.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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":"2024-05-08T03:48:24.000Z","updated_at":"2024-05-25T14:29:12.000Z","dependencies_parsed_at":"2024-10-30T04:14:48.244Z","dependency_job_id":null,"html_url":"https://github.com/NMNMCC/litro","commit_stats":null,"previous_names":["intzaaa/tit","intzaaa/litro","nmnmcc/litro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMNMCC%2Flitro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMNMCC%2Flitro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMNMCC%2Flitro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NMNMCC%2Flitro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NMNMCC","download_url":"https://codeload.github.com/NMNMCC/litro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544824,"owners_count":22088808,"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":["easy-to-use","javascript","library","lit","lit-element","lit-html","npm","router","tit","typescript","web-components"],"created_at":"2025-05-16T14:14:15.246Z","updated_at":"2026-04-18T04:33:23.126Z","avatar_url":"https://github.com/NMNMCC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# litro (`lit-litro`)\n\nA bland and boring router and styler for lit.\n\n- [x] router\n- [ ] styler\n\n## Install\n\n```sh\npnpm i lit-litro\n```\n\n## Usage\n\n### Router\n\n1. (You still need to) `import` all the pages and templates, litro can't help you with this\n2. Replace `@customElement` to `@page` or `@template`\n3. Add `\u003clitro-router\u003e\u003c/litro-router\u003e` your entry file, for example `index.html` if you are using Vite.\n\n#### Example\n\n```html\n\u003c!-- index.html (Vite) --\u003e\n\n\u003chead\u003e\n  \u003cscript type=\"module\"\u003e\n    import \"lit-litro\";\n    import.meta.glob(\"/**/*.ts\", { eager: true });\n  \u003c/script\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  \u003clitro-router\u003e\u003c/litro-router\u003e\n\u003c/body\u003e\n```\n\n```ts\n// src/pages/my-page.ts\n\nimport { LitElement, html } from \"lit\";\nimport { page } from \"lit-litro/router\";\n\n@page(\"/\", \"hello-litro\")\nexport class MyPage extends LitElement {\n  // ...\n}\n```\n\n```ts\n// src/pages/my-template.ts\n\nimport { LitElement, html } from \"lit\";\nimport { template } from \"lit-litro/router\";\n\n@template(0, (path) =\u003e path.includes(\"goodbye\") , \"are-you-joking\")\nexport class MyTemplate extends LitElement {\n  // ...\n}\n```\n\n### Styler\n\n*Make lit follow CSS's scoping rules?*\n\n*I still have no clue about this...*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmnmcc%2Flitro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmnmcc%2Flitro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmnmcc%2Flitro/lists"}