{"id":15636466,"url":"https://github.com/alii/pathcat","last_synced_at":"2025-04-04T18:08:15.221Z","repository":{"id":214137641,"uuid":"735796621","full_name":"alii/pathcat","owner":"alii","description":"Simply path/URL building in JavaScript","archived":false,"fork":false,"pushed_at":"2024-10-10T16:48:45.000Z","size":1119,"stargazers_count":189,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:09:15.218Z","etag":null,"topics":["http","networking","nodejs","typescript","urls","utility"],"latest_commit_sha":null,"homepage":"https://npm.im/pathcat","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["alii"]}},"created_at":"2023-12-26T05:29:56.000Z","updated_at":"2025-02-24T17:16:07.000Z","dependencies_parsed_at":"2024-04-26T10:27:32.801Z","dependency_job_id":"9137794f-59f7-4e79-a8d7-4dddadafc7be","html_url":"https://github.com/alii/pathcat","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.09677419354838712,"last_synced_commit":"ade0d09fe60e10d647075d6429c95ae5ab269736"},"previous_names":["alii/pathcat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpathcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpathcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpathcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alii%2Fpathcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alii","download_url":"https://codeload.github.com/alii/pathcat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["http","networking","nodejs","typescript","urls","utility"],"created_at":"2024-10-03T11:04:14.337Z","updated_at":"2025-04-04T18:08:15.195Z","avatar_url":"https://github.com/alii.png","language":"TypeScript","readme":"# `pathcat` 🐾\n\nSimply path/URL building in JavaScript. Intelligently handles URL params and query strings.\n\nThis library owes thanks to urlcat, but unfortunately it seems to be abandoned. You can mostly use pathcat as a replacement.\n\n## Features\n\n- Very intuitive API\n- Supports URL params and query string\n- Avoids double slashes\n- Zero dependencies\n- Absolutely tiny install size\n\n## Install\n\n```sh\nyarn add pathcat\n```\n\n## Usage\n\n```typescript\nimport { pathcat } from \"pathcat\";\n\npathcat(\"https://example.com\", \"/:id\", {\n\tid: 123,\n});\n// =\u003e 'https://example.com/123'\n\npathcat(\"https://example.com\", \"/:id\", {\n\tid: \"123\",\n\tfoo: \"bar\",\n});\n// =\u003e 'https://example.com/123?foo=bar'\n\n// Base URL is optional, works on just paths as well.\npathcat(\"/users/:user_id/posts/:post_id\", {\n\tuser_id: \"123\",\n\tpost_id: 456,\n\tcool_flag: true,\n});\n// =\u003e '/users/123/posts/456?cool_flag=true'\n\n// You can also use arrays for query string values\npathcat(\"/users/:user_id/posts/:post_id\", {\n\tuser_id: \"123\",\n\tpost_id: 456,\n\tcool_flag: true,\n\tfields: [\"title\", \"body\"],\n});\n// =\u003e '/users/123/posts/456?cool_flag=true\u0026fields=title\u0026fields=body'\n```\n\n## Benchmark:\n\nResults when running on an M3 Max\n\n```\n$ node --import=tsx benchmark.ts\n\nWith a base URL x 2,628,829 ops/sec ±0.70% (95 runs sampled)\nWith no base URL x 3,160,695 ops/sec ±0.50% (96 runs sampled)\nWith a base URL, and no params x 70,782,166 ops/sec ±1.93% (88 runs sampled)\n```\n\n## Notes:\n\n- Any params or query string values that are `undefined` will be omitted.\n- Params that were not specified in the object will be left as is.\n","funding_links":["https://github.com/sponsors/alii"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falii%2Fpathcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falii%2Fpathcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falii%2Fpathcat/lists"}