{"id":19834128,"url":"https://github.com/eibens/module_url","last_synced_at":"2026-05-15T03:32:36.778Z","repository":{"id":102373331,"uuid":"394459915","full_name":"eibens/module_url","owner":"eibens","description":"Extract version number, module name, and more from ESM or TypeScript module URLs.","archived":false,"fork":false,"pushed_at":"2022-02-18T11:14:05.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-17T00:17:53.922Z","etag":null,"topics":["deno","parser","typescript","url","versioning"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/eibens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2021-08-09T22:47:39.000Z","updated_at":"2022-02-18T11:07:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"42db0def-95a7-47d1-afff-860bb00ebe3b","html_url":"https://github.com/eibens/module_url","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"743b860c828a205fd463afd4a9f3b7523df9a473"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/eibens/module_url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fmodule_url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fmodule_url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fmodule_url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fmodule_url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eibens","download_url":"https://codeload.github.com/eibens/module_url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fmodule_url/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33052631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"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":["deno","parser","typescript","url","versioning"],"created_at":"2024-11-12T12:03:17.067Z","updated_at":"2026-05-15T03:32:36.762Z","avatar_url":"https://github.com/eibens.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# module_url\n\n[module_url] is a library for extracting information from a TypeScript or ESM\nmodule URL. It provides parsers for various [formats](#formats). It is\nimplemented in TypeScript for Deno.\n\n[![License][license-shield]](LICENSE)\n[![Deno module][deno-land-shield]][deno-land]\n[![Github\ntag][github-shield]][github] [![Build][build-shield]][build]\n[![Code\ncoverage][coverage-shield]][coverage]\n\n# Usage\n\nImport a parser that supports all formats:\n\n```ts\nimport { parse } from \"https://deno.land/x/module_url/mod.ts\";\n```\n\nImport a parser for a single format:\n\n```ts\nimport { parse } from \"https://deno.land/x/module_url/formats/deno_x.ts\";\n```\n\nUse the parser to parse a URL:\n\n```ts\nimport { parse } from \"https://deno.land/x/module_url/mod.ts\";\n\n// Parse a URL.\nconst url = \"https://deno.land/x/module_url@v1.2.3/mod.ts\";\nconst { format, name, path, base, tag } = parse(url);\n\n// Test the results.\nconsole.assert(format === \"deno_x\");\nconsole.assert(name === \"module_url\");\nconsole.assert(path === \"mod.ts\");\nconsole.assert(tag === \"v1.2.3\");\nconsole.assert(base === \"https://deno.land/x/module_url@v1.2.3/\");\n```\n\nIf the format is not supported by the parser, it throws an `Error`:\n\n```ts\nimport { parse } from \"https://deno.land/x/module_url/formats/deno_x.ts\";\n\n// This URL format is not supported by deno_x parser.\nconst url = \"file:///home/user/example/mod.ts\";\ntry {\n  parse(url);\n  // The line above should have thrown an error.\n  console.assert(false);\n} catch (error) {\n  // Success!\n}\n```\n\n# Formats\n\nThese are the formats currently supported by [module_url]. This list might grow\nin the future.\n\n## Misc\n\n- [`unknown`](formats/unknown.ts): catch-all for unknown formats\n  \u003cbr\u003epattern: (matches any valid URL)\n\n- [`local`](formats/local.ts): local file system\n  \u003cbr\u003epattern: `file:///**/\u003cname\u003e[@\u003ctag\u003e]/\u003cpath\u003e`\n\n## Deno\n\n- [`deno_x`](formats/deno_x.ts): [Deno third party] modules\n  \u003cbr\u003epattern: `https://deno.land/x/\u003cname\u003e[@\u003ctag\u003e]/\u003cpath\u003e`\n\n- [`deno_std`](formats/deno_std.ts): [Deno standard] library modules\n  \u003cbr\u003epattern: `https://deno.land/std[@\u003ctag\u003e]/\u003cname\u003e/\u003cpath\u003e`\n\n## GitHub\n\n- [`github`](formats/github.ts): raw files on [GitHub](https://github.com)\n  \u003cbr\u003epattern: `https://raw.githubusercontent.com/*/\u003cname\u003e/\u003ctag\u003e/\u003cpath\u003e`\n\n\u003c!-- references --\u003e\n\n[module_url]: #\n[deno third party]: https://deno.land/x/\n[deno standard]: https://deno.land/std/\n\n\u003c!-- badges --\u003e\n\n[github]: https://github.com/eibens/module_url\n[github-shield]: https://img.shields.io/github/v/tag/eibens/module_url?label\u0026logo=github\n[coverage-shield]: https://img.shields.io/codecov/c/github/eibens/module_url?logo=codecov\u0026label\n[license-shield]: https://img.shields.io/github/license/eibens/module_url?color=informational\n[coverage]: https://codecov.io/gh/eibens/module_url\n[build]: https://github.com/eibens/module_url/actions/workflows/ci.yml\n[build-shield]: https://img.shields.io/github/workflow/status/eibens/module_url/ci?logo=github\u0026label\n[deno-land]: https://deno.land/x/module_url\n[deno-land-shield]: https://img.shields.io/badge/x/module__url-informational?logo=deno\u0026label\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feibens%2Fmodule_url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feibens%2Fmodule_url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feibens%2Fmodule_url/lists"}