deno/ext/url
denobot 4c1cdfc9a4
2.5.1 (#30753)
Bumped versions for 2.5.1

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-09-17 01:58:00 +02:00
..
benches chore: update to edition 2024 (#29923) 2025-07-02 17:59:39 -07:00
00_url.js chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
01_urlpattern.js fix: move extension file declarations to cli/tsc/dts (#28180) 2025-02-19 02:53:21 +01:00
Cargo.toml 2.5.1 (#30753) 2025-09-17 01:58:00 +02:00
internal.d.ts chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
lib.rs chore: Rust 1.89.0 (#30364) 2025-08-09 11:11:48 +00:00
README.md refactor: allow lazy main module (#28929) 2025-04-30 19:59:20 +00:00
urlpattern.rs refactor: update deno_core for error refactor (#26867) 2025-01-08 14:52:32 -08:00

deno_url

This crate implements the URL, and URLPattern APIs for Deno.

URL Spec: https://url.spec.whatwg.org/ URLPattern Spec: https://wicg.github.io/urlpattern/

Usage Example

From javascript, include the extension's source, and assign URL, URLPattern, and URLSearchParams to the global scope:

import * as url from "ext:deno_url/00_url.js";
import * as urlPattern from "ext:deno_url/01_urlpattern.js";

Object.defineProperty(globalThis, "URL", {
  value: url.URL,
  enumerable: false,
  configurable: true,
  writable: true,
});

Object.defineProperty(globalThis, "URLPattern", {
  value: url.URLPattern,
  enumerable: false,
  configurable: true,
  writable: true,
});

Object.defineProperty(globalThis, "URLSearchParams", {
  value: url.URLSearchParams,
  enumerable: false,
  configurable: true,
  writable: true,
});

Then from rust, provide deno_url::deno_url::init() in the extensions field of your RuntimeOptions

Dependencies

  • deno_webidl: Provided by the deno_webidl crate

Provided ops

Following ops are provided, which can be accessed through Deno.ops:

  • op_url_reparse
  • op_url_parse
  • op_url_get_serialization
  • op_url_parse_with_base
  • op_url_parse_search_params
  • op_url_stringify_search_params
  • op_urlpattern_parse
  • op_urlpattern_process_match_input