{"id":15220470,"url":"https://github.com/compts/url-assist","last_synced_at":"2025-11-09T23:03:39.121Z","repository":{"id":57689896,"uuid":"483208975","full_name":"compts/url-assist","owner":"compts","description":"URL tools at your ease","archived":false,"fork":false,"pushed_at":"2025-09-15T10:37:27.000Z","size":505,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-15T12:25:39.354Z","etag":null,"topics":["javascript","javascript-library","utility-library"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/compts.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-19T11:01:34.000Z","updated_at":"2025-07-01T17:03:17.000Z","dependencies_parsed_at":"2022-09-26T20:53:51.168Z","dependency_job_id":"d038410d-2d95-489a-a998-eec8be283073","html_url":"https://github.com/compts/url-assist","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/compts/url-assist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compts%2Furl-assist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compts%2Furl-assist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compts%2Furl-assist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compts%2Furl-assist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compts","download_url":"https://codeload.github.com/compts/url-assist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compts%2Furl-assist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283593385,"owners_count":26861541,"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","status":"online","status_checked_at":"2025-11-09T02:00:05.828Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","javascript-library","utility-library"],"created_at":"2024-09-28T13:10:28.936Z","updated_at":"2025-11-09T23:03:39.100Z","avatar_url":"https://github.com/compts.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UrlAssist\n[![NPM version][npm-image]][npm-url]\n[![Build Status](https://github.com/compts/url-assist/actions/workflows/cicd.yaml/badge.svg?branch=main)](https://github.com/compts/url-assist/actions)\n[![NPM Downloads](https://img.shields.io/npm/dm/url-assist?logo=npm\u0026style=flat-square)](https://npmtrends.com/url-assist)\n[![install size](https://packagephobia.com/badge?p=url-assist)](https://packagephobia.com/result?p=url-assist)\n\n[Site](https://urlassist.codehyouka.xyz/) |\n[Docs](https://urlassist.codehyouka.xyz/api) |\n\n## Download\n\n * [Core build](https://raw.githubusercontent.com/compts/url-assist/main/dist/web/url-assist.js) ([~10KB](https://raw.githubusercontent.com/compts/url-assist/main/dist/web/url-assist.js))\n * [Dependency build](https://raw.githubusercontent.com/compts/structkit/main/dist/web/structkit-full.iife.js)  ([~65KB](https://raw.githubusercontent.com/compts/structkit/main/dist/web/structkit-full.iife.js))\n\nUsing npm:\n```shell\n$ npm i url-assist\n```\n\n## How to import the Library\n\nIn a browser :\n```html\n\u003cscript src=\"structkit-full.iife.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"url-assist.js\"\u003e\u003c/script\u003e\n```\n\nImport on cjs\n```bash\nconst {isUrlExtValid} = require('url-assist');\n\n```\n\nImport on ESM or TS\n```bash\nimport {isUrlExtValid} from 'url-assist';\n\n```\n\n## Example\n\nIn a browser\n```html\nurs.isUrlExtValid('https://example.com/example.js', 'js')\n```\nkeep in mind `urs` is used as global library at html\n\n\nCJS, ESM and TS use this code below\n```bash\nisUrlExtValid('https://example.com/example.js', 'js')\n\n```\n\n[npm-url]: https://www.npmjs.com/package/url-assist\n[npm-image]: https://img.shields.io/badge/url_assist-1.2.72-brightgreen\n\n## List of method you can use to check your url\n\n[match pattern against extension in url](#match-pattern-extension-url)\n``` javascript\nisUrlExtValid('https://example.com/example.js', 'js')// true\nisUrlExtValid('https://example.com/example.js', 'css')// false\n```\n[get the domain or url details](#get-domain-details)\n``` javascript\ngetHostDetails('https://www.example.com')\n// =\u003e {\n//            \"domainDetails\": {\n//                \"domain\": \"example\",\n//                \"domainWithTld\": \"example.com\",\n//                \"subdomain\": \"www\",\n//                \"tld\": \"com\"\n//            },\n//            \"hash\": \"\",\n//            \"hostname\": 'www.example.com',\n//            \"href\": 'https://www.example.com',\n//            \"password\": \"\",\n//            \"pathname\": \"\",\n//            \"port\": \"\",\n//            \"protocol\": \"https\",\n//            \"search\": '',\n//            \"user\": ''\n//        }\n```\n\n[check if url is valid https](#check-valid-https)\n``` javascript\nisHttps('https://example.com')// true\n```\n\n[Verify your pattern and url structure](#check-valid-https)\n``` javascript\ndata = urs.urlPattern(\"/:id\", \"/test\")\ndata.isValid() // true\ndata.getParam() // {id: 'test'}\n\n```\n\n[Verify your pattern and url structure only number as parameter](#check-valid-https)\n``` javascript\ndata = urs.urlPattern(\"/:id\u003cnumber\u003e\", \"/1\")\ndata.isValid() // true\ndata.getParam() // {id: '1'}\n\n```\n\n[Compose your url structure](#check-valid-https)\n``` javascript\ndata = urlComposer('https://example.com')\ndata.getToString() // 'https://example.com'\ndata.setDomainSubdomain(\"api\")\ndata.getToString() // 'https://api.example.com'\ndata.setProtocol(\"http\")\ndata.getToString() // http://api.example.com/\n\n```\n\n[Query String parser](#query-string-parser)\n``` javascript\nqsParse(\"test=1\u0026test2=11\") //{\"test\": 11,\"test2\": 11}\n\n```\n\n[Query String to Stringify](#query-string-stringify)\n``` javascript\nqsStringify({\"test\": 11,\"test2\": 11}) //test=1\u0026test2=11\n\n```\n\n[To join the path](#to-join-path)\n``` javascript\njoinUrlPath('https://example.com','test') //https://example.com/test\n\n```\n\n[Check url is valid format](#check-valid-format-url)\n``` javascript\nisUrlValidFormat('https://example.com')// true\nisUrlValidFormat('ftp://example.com')// false\n```\n\n[Check https only](#check-https-url)\n``` javascript\nisHttps('https://example.com')// true\nisHttps('http://example.com')// false\n```\n\n\n[slugify your url/path](#slugify)\n``` javascript\nslugify(\"Hello world 123\")// \"hello-world-123\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompts%2Furl-assist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompts%2Furl-assist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompts%2Furl-assist/lists"}