{"id":26605824,"url":"https://github.com/hamxabaig/url-from-template","last_synced_at":"2025-08-26T16:16:16.066Z","repository":{"id":57387548,"uuid":"162831671","full_name":"hamxabaig/url-from-template","owner":"hamxabaig","description":"Convert your route templates into valid urls :rocket:","archived":false,"fork":false,"pushed_at":"2018-12-22T18:06:16.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T09:19:35.164Z","etag":null,"topics":["querystring","route","url","url-generator"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamxabaig.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-22T17:50:07.000Z","updated_at":"2018-12-26T05:49:02.000Z","dependencies_parsed_at":"2022-09-07T14:51:31.312Z","dependency_job_id":null,"html_url":"https://github.com/hamxabaig/url-from-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamxabaig%2Furl-from-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamxabaig%2Furl-from-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamxabaig%2Furl-from-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamxabaig%2Furl-from-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamxabaig","download_url":"https://codeload.github.com/hamxabaig/url-from-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244250050,"owners_count":20423085,"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":["querystring","route","url","url-generator"],"created_at":"2025-03-23T21:16:36.011Z","updated_at":"2025-03-23T21:16:36.849Z","avatar_url":"https://github.com/hamxabaig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-from-template [![Build Status](https://travis-ci.com/hamxabaig/url-from-template.svg?branch=master)](https://travis-ci.com/hamxabaig/url-from-template)\n\n\u003e A module to convert route template strings like `/my-route/:id` into valid url according to the params \u0026 query given. :rocket:\n\n\n## Install\n\n```\n$ npm install url-from-template\n```\n\n\n## Usage\n\n```js\nconst buildUrl = require('url-from-template');\n\nbuildUrl('/test/:id', {params: {id: '123'}});\n//=\u003e '/test/123'\n\nbuildUrl('/test/:id', {params: {id: '123'}, query: {awesome: 'yeah'}});\n//=\u003e '/test/123?awesome=yeah'\n```\n\n\n## API\n\n### buildUrl(template, options)\n\n#### template\n\nType: `string`\n\nTemplate to generate url from. For params, you can use `:` to make it a param.\n\u003e When you give param to route, you must give its value in params object in options.\n\n#### options\n\nType: `Object`\n\n##### params\n\nType: `Object`\u003cbr\u003e\n\nParams to replace in template.\n\n##### query\n\nType: `Object`\u003cbr\u003e\n\nQuery params to add in route. \n\u003e If your query has invalid value, it'll not be in the return url.\n\n## Dependencies\n\nIt uses the following awesome libraries:\n- [query-string](https://github.com/sindresorhus/query-string)\n- [route-parser](https://github.com/rcs/route-parser)\n\n## License\n\nMIT © with :heart: \u0026 :coffee: by [Hamza Baig](http://hamxabaig.github.io)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamxabaig%2Furl-from-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamxabaig%2Furl-from-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamxabaig%2Furl-from-template/lists"}