{"id":13725511,"url":"https://github.com/lukeed/url-shim","last_synced_at":"2025-10-09T18:23:51.789Z","repository":{"id":57387640,"uuid":"227673034","full_name":"lukeed/url-shim","owner":"lukeed","description":"A 1.5kB browser polyfill for the Node.js `URL` and `URLSearchParams` classes.","archived":false,"fork":false,"pushed_at":"2019-12-17T05:41:41.000Z","size":36,"stargazers_count":126,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-21T02:23:54.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/lukeed.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":"2019-12-12T18:38:31.000Z","updated_at":"2025-07-08T05:54:10.000Z","dependencies_parsed_at":"2022-09-26T16:50:55.967Z","dependency_job_id":null,"html_url":"https://github.com/lukeed/url-shim","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/url-shim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Furl-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Furl-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Furl-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Furl-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/url-shim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Furl-shim/sbom","scorecard":{"id":604552,"data":{"date":"2025-08-11","repo":{"name":"github.com/lukeed/url-shim","commit":"543d66e0bd0e1d7b8f5a31699d294907c68d788b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/url-shim/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/url-shim/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:23","Warn: downloadThenRun not pinned by hash: .github/workflows/ci.yml:30","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T01:16:40.565Z","repository_id":57387640,"created_at":"2025-08-21T01:16:40.565Z","updated_at":"2025-08-21T01:16:40.565Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001940,"owners_count":26083226,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-08-03T01:02:25.614Z","updated_at":"2025-10-09T18:23:51.729Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# url-shim [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/url-shim)](https://codecov.io/gh/lukeed/url-shim)\n\n\u003e A 1.53kB browser polyfill for the Node.js `URL` and `URLSearchParams` classes.\n\n**Why?**\n\n* All browser implementations *are not* 100% identical to the Node.js implementation.\u003cbr\u003e\n_For example, browsers have issue with custom protocols, which affects the `origin` and `pathname` parsing._\n\n* Most polyfills match the browser implementations.\u003cbr\u003e\n_But what if you have a \"universal app\" and want to guarantee client/server uniformity?_\n\n* Most polyfills immediately (albeit, conditionally) mutate global scope.\u003cbr\u003e\n_You can't declaratively import their implementations for standalone usage._\n\n\u003e **Note:** The only other library that satisfies these requirements is [`whatwg-url`](https://github.com/jsdom/whatwg-url), but it [weighs **87.6 kB (gzip)**](https://bundlephobia.com/result?p=whatwg-url@7.1.0)!\n\nThis module is available in three formats:\n\n* **ES Module**: `dist/urlshim.mjs`\n* **CommonJS**: `dist/urlshim.js`\n* **UMD**: `dist/urlshim.min.js`\n\n\n## Install\n\n```\n$ npm install --save url-shim\n```\n\n\n## Usage\n\n```js\nimport { URL, URLSearchParams } from 'url-shim';\n\n// composition\nnew URL('/foo', 'https://example.org/').href;\n//=\u003e \"https://example.org/foo\"\n\n// unicode -\u003e ASCII conversion\nnew URL('https://測試').href;\n//=\u003e \"https://xn--g6w251d/\"\n\n// custom protocols w/ path\nnew URL('webpack:///src/bundle.js');\n//=\u003e { protocol: \"webpack:\", pathname: \"/src/bundle.js\", ... }\n\n// custom protocols w/ hostname\nnew URL('git://github.com/lukeed/url-shim');\n//=\u003e { protocol: \"git:\", hostname: \"github.com\", pathname: \"/lukeed/url-shim\", ... }\n\nnew URL('http://foobar.com/123?a=1\u0026b=2').searchParams instanceof URLSearchParams;\n//=\u003e true\n\nconst params = new URLSearchParams('foo=bar\u0026xyz=baz');\nfor (const [name, value] of params) {\n  console.log(name, value);\n}\n// Prints:\n//   foo bar\n//   xyz baz\n```\n\n## API\n\n### URL(input, base?)\n\u003e **Size (gzip):** `1.53 kB`\n\nSee [Node.js documentation](https://nodejs.org/dist/latest-v12.x/docs/api/url.html#url_class_url) for info.\n\n\u003e **Important:** Requires a browser environment because `document.createElement` is used for URL parsing.\n\n### URLSearchParams(input?)\n\u003e **Size (gzip):** `944 B`\n\nSee [Node.js documentation](https://nodejs.org/dist/latest-v12.x/docs/api/url.html#url_class_urlsearchparams) for info.\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Furl-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Furl-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Furl-shim/lists"}