{"id":22173230,"url":"https://github.com/litejs/uri-template-lite","last_synced_at":"2025-04-13T14:43:36.005Z","repository":{"id":12941792,"uuid":"15619701","full_name":"litejs/uri-template-lite","owner":"litejs","description":"URI Template RFC 6570 expansion and extraction","archived":false,"fork":false,"pushed_at":"2025-04-13T11:15:46.000Z","size":92,"stargazers_count":19,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T12:24:20.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://litejs.com","language":"JavaScript","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/litejs.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":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"lauriro"}},"created_at":"2014-01-03T21:14:22.000Z","updated_at":"2025-04-13T11:15:49.000Z","dependencies_parsed_at":"2024-06-18T15:34:23.496Z","dependency_job_id":"f5b78459-e73e-48a0-9c2a-0ae7011872ef","html_url":"https://github.com/litejs/uri-template-lite","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"59c5ab344f0e04c8bd648a902f82342df3498977"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Furi-template-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Furi-template-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Furi-template-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Furi-template-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litejs","download_url":"https://codeload.github.com/litejs/uri-template-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713163,"owners_count":21149641,"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-12-02T07:31:23.959Z","updated_at":"2025-04-13T14:43:35.938Z","avatar_url":"https://github.com/litejs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/lauriro","https://www.buymeacoffee.com/lauriro"],"categories":[],"sub_categories":[],"readme":"\n[1]: https://badgen.net/coveralls/c/github/litejs/uri-template-lite\n[2]: https://coveralls.io/r/litejs/uri-template-lite\n[3]: https://badgen.net/packagephobia/install/uri-template-lite\n[4]: https://packagephobia.now.sh/result?p=uri-template-lite\n[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi\u0026label\n[6]: https://www.buymeacoffee.com/lauriro\n\n\nURI Template Lite \u0026ndash; [![Coverage][1]][2] [![size][3]][4] [![Buy Me A Tea][5]][6]\n=================\n\nURI Template [RFC 6570](http://tools.ietf.org/html/rfc6570) expansion and extraction.\n\n\nUsage\n-----\n\n`npm install uri-template-lite`\n\n```javascript\nvar UriTemplate = require(\"uri-template-lite\")\n\n// Call `expand` directly\nvar data = {\"domain\":\"example.com\", \"user\":\"fred\", \"query\":\"mycelium\"}\nUriTemplate.expand(\"http://{domain}/~{user}/foo{?query,number}\", data)\n// Returns http://example.com/~fred/foo?query=mycelium\n\n// ..or use `Template` constructor\nvar template = new UriTemplate(\"http://{domain}/~{user}/foo{?query,number}\")\ntemplate.expand({\"domain\":\"example.com\", \"user\":\"fred\", \"query\":\"mycelium\", \"number\": 3})\n// Returns http://example.com/~fred/foo?query=mycelium\u0026number=3\n\n// Extract variables\ntemplate.match(\"http://example.com/~fred/foo?query=mycelium\u0026number=3\")\n// Returns {\"domain\":\"example.com\", \"user\":\"fred\", \"query\":\"mycelium\", \"number\": \"3\"}\n\ntemplate.match(\"http://other.com/?query=mycelium\")\n// Returns null\n```\n\n\n\nAbout error handling\n--------------------\n\nThis implementation tries to do a best effort template expansion\nand leaves erroneous expressions in the returned URI\ninstead of throwing errors.\nSo for example, the incorrect expression\n{unclosed will return {unclosed as output.\n\n\n\n\u003e Copyright (c) 2014-2023 Lauri Rooden \u0026lt;lauri@rooden.ee\u0026gt;  \n[MIT License](https://litejs.com/MIT-LICENSE.txt) |\n[GitHub repo](https://github.com/litejs/uri-template-lite) |\n[npm package](https://npmjs.org/package/@litejs/uri-template-lite) |\n[Buy Me A Tea][6]\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitejs%2Furi-template-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitejs%2Furi-template-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitejs%2Furi-template-lite/lists"}