{"id":28625652,"url":"https://github.com/bearstudio/lunalink","last_synced_at":"2025-06-12T08:11:11.799Z","repository":{"id":279995881,"uuid":"937776148","full_name":"BearStudio/lunalink","owner":"BearStudio","description":"Lightweight TypeScript library to efficiently maintain and build URLs","archived":false,"fork":false,"pushed_at":"2025-05-24T09:10:08.000Z","size":691,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T04:58:16.373Z","etag":null,"topics":["alternative","builder","dynamic","link","luna","parameters","ts","typescript","url"],"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/BearStudio.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":"2025-02-23T21:28:09.000Z","updated_at":"2025-05-24T09:10:11.000Z","dependencies_parsed_at":"2025-02-28T21:13:43.773Z","dependency_job_id":"d03cc7d7-b1b2-4b95-be9e-844ed13d4af0","html_url":"https://github.com/BearStudio/lunalink","commit_stats":null,"previous_names":["bearstudio/lunalink"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/BearStudio/lunalink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearStudio%2Flunalink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearStudio%2Flunalink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearStudio%2Flunalink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearStudio%2Flunalink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BearStudio","download_url":"https://codeload.github.com/BearStudio/lunalink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BearStudio%2Flunalink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259427072,"owners_count":22855564,"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":["alternative","builder","dynamic","link","luna","parameters","ts","typescript","url"],"created_at":"2025-06-12T08:11:10.503Z","updated_at":"2025-06-12T08:11:11.768Z","avatar_url":"https://github.com/BearStudio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lunalink\n\n![luna the cat with the title lunalink on her head](./apps/web/public/lunalink.jpeg)\n\nThis library is an alternative to [`urlcat`](https://github.com/balazsbotond/urlcat)\nwhich isn't maintained anymore. That is why it is named after my **cat**, Luna 🐈‍⬛.\nLink is because it is easy to say after `luna`. That's it, that's the whole story.\n\nI ([@yoannfleurydev](https://github.com/yoannfleurydev)), did not want to fork\n`urlcat` to challenge myself into reimplementing it. Some API design are made to\nsimplify my development, I hope it will simplify yours too.\n\n## Features\n\n- 🤏 Tiny (**2.8 kB** minified + gzipped)\n- 🟦 TypeScript first\n- 🧪 Fully tested\n\n## Installation\n\nInstall the package using your favorite package manager:\n\n```sh\nnpm install @bearstudio/lunalink\nyarn add @bearstudio/lunalink\npnpm add @bearstudio/lunalink\n```\n\n## Usage\n\nGo from this kind of code:\n\n```ts\ntype EventCategoryType = {\n  year: number;\n  typeId: string;\n  categoryId: string;\n  filter?: string;\n  page?: string;\n  size?: string;\n}\n\nconst useEventCategory = (params: EventCategoryType) =\u003e {\n  const api = useApi();\n\n  return useQuery({\n    queryKey: ['event', 'type', 'category', params],\n    queryFn: async () =\u003e {\n      const searchParams = new URLSearchParams(pick(params, ['filter', 'page', 'size']));\n\n      const response = await api.get(`demo/event/${params.year}/type/${params.typeId}/category/${params.categoryId}?${searchParams.toString()}`);\n\n      return response.json();\n    }\n  })\n}\n```\n\n\u003e 💡 This sample of code was purely invented for the example.\n\nto this kind of code:\n\n```ts\nimport { lunalink, ExtractParams } from \"@bearstudio/lunalink\";\n\nconst EventCategoryIdRoute = 'demo/event/:year/type/:typeId/category/:categoryId'\ntype EventCategoryIdRouteType = ExtractParams\u003ctypeof EventTypeCategoryId\u003e \u0026 {\n  filter?: string;\n  page?: string;\n  size?: string;\n}\n\nconst useEventCategory = (params:) =\u003e {\n  const api = useApi();\n\n  return useQuery({\n    queryKey: ['event', 'type', 'category', params],\n    queryFn: async () =\u003e {\n      const response = await api.get(lunalink(EventTypeCategoryId, params));\n\n      return response.json();\n    }\n  })\n}\n```\n\nso you don't have to maintain your type yourself, and enjoy readability.\n\n## API\n\n```ts\nimport { lunalink, ExtractParams } from \"@bearstudio/lunalink\";\n\n// lunalink(path, variables, config)\nlunalink(\"a/path/with/:variables\", { variables: \"a-variable\" }, { baseURL: \"https://example.org\" })\n```\n\n## What's inside?\n\nThis monorepo includes the following packages/apps:\n\n### Apps and Packages\n\n- `web`: a [Next.js](https://nextjs.org/) app\n- `@repo/lunalink`: the source code of the library. Learn mode about it in its dedicated [README](./packages/lunalink/README.md)\n- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)\n- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo\n\nEach package/app is 100% [TypeScript](https://www.typescriptlang.org/).\n\n### Build\n\nTo build all apps and packages, run the following command:\n\n```\npnpm build\n```\n\n### Develop\n\nTo develop all apps and packages, run the following command:\n\n```\npnpm dev\n```\n\n## Useful Links\n\nLearn more about the power of Turborepo:\n\n- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)\n- [Caching](https://turbo.build/repo/docs/core-concepts/caching)\n- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)\n- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)\n- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)\n- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearstudio%2Flunalink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearstudio%2Flunalink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearstudio%2Flunalink/lists"}