{"id":20240898,"url":"https://github.com/aquapi/wint","last_synced_at":"2025-04-10T19:51:18.845Z","repository":{"id":204261650,"uuid":"711410398","full_name":"aquapi/wint","owner":"aquapi","description":"A collection of high-performance URL routers for JavaScript","archived":false,"fork":false,"pushed_at":"2024-02-11T10:23:22.000Z","size":78,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T21:05:22.627Z","etag":null,"topics":[],"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/aquapi.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":"2023-10-29T07:12:47.000Z","updated_at":"2025-03-20T05:42:47.000Z","dependencies_parsed_at":"2023-11-09T12:04:47.808Z","dependency_job_id":"09a5327b-c263-4c42-a166-19c84a2a559d","html_url":"https://github.com/aquapi/wint","commit_stats":null,"previous_names":["aquapi/wint"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquapi%2Fwint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquapi%2Fwint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquapi%2Fwint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquapi%2Fwint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquapi","download_url":"https://codeload.github.com/aquapi/wint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248283492,"owners_count":21077857,"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-14T08:50:25.077Z","updated_at":"2025-04-10T19:51:18.823Z","avatar_url":"https://github.com/aquapi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wint\nWint is a collection of high performance, heavily optimized \nURL routers for building web frameworks and applications.\n\nWint is compatible for every runtime that does support the `Function` constructor such as Bun, Node or Deno.\n\n## Features\nAll routers support wildcard and URL parameters matching.\n\n## API\nRouters have three common methods.\n```ts\n/**\n * Add a route handler.\n */\nput(method: string, path: string, handler: T): this;\n\n/**\n * Find the matching item. Use after calling the `build` function.\n */\nfind(c: Context): T | null;\n\n/**\n * Build the `find` function for the router.\n */\nbuild(): this;\n```\n\nThe `build` function must be called before calling `find`.\n\n## Routers\nCurrently two routers are supported.\n\n### Basic router\nThis router matches the URL with a radix tree.\n\nThe difference between this and other radix tree routers\nsuch as `radix3` and `@medley/router` is that the matcher \nis compiled ahead of time, which brings a performance advantage.\n\n```ts\nimport Wint from 'wint-js';\n\n// Create and add routes\nconst wint = new Wint\u003c() =\u003e string\u003e()\n    .put('GET', '/', () =\u003e 'Hi')\n    .put('POST', '/json', () =\u003e '{}')\n    .put('ALL', '/', () =\u003e 'Not found')\n    .build();\n\n// This is designed to be compatible with the `Request` object\nwint.find({\n    method: 'POST',\n    path: 'json' // Path should slice the first slash character\n}); // () =\u003e '{}'\n```\n\n### Turbo router\nTurbo router matches much faster than basic router but does not support `ALL` method handler.\n\n```ts\nimport Wint from 'wint-js/turbo';\n\n// Create and add routes\nconst wint = new Wint\u003c() =\u003e string\u003e()\n    .put('GET', '/', () =\u003e 'Hi')\n    .put('POST', '/json', () =\u003e '{}')\n    .build();\n\n// This is designed to be compatible with the `Request` object\nwint.find({\n    method: 'POST',\n    url: 'http://localhost:3000/json'\n}); // () =\u003e '{}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquapi%2Fwint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquapi%2Fwint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquapi%2Fwint/lists"}