191 breaking releases

0.194.0 Mar 5, 2025
0.192.0 Feb 20, 2025
0.184.0 Dec 19, 2024
0.180.0 Nov 28, 2024
0.2.0 Mar 21, 2021

#1995 in Web programming

Download history 4687/week @ 2024-11-19 4112/week @ 2024-11-26 4563/week @ 2024-12-03 5051/week @ 2024-12-10 4448/week @ 2024-12-17 1744/week @ 2024-12-24 2167/week @ 2024-12-31 4908/week @ 2025-01-07 5315/week @ 2025-01-14 5377/week @ 2025-01-21 5177/week @ 2025-01-28 5153/week @ 2025-02-04 5592/week @ 2025-02-11 5076/week @ 2025-02-18 6934/week @ 2025-02-25 5283/week @ 2025-03-04

23,604 downloads per month
Used in 68 crates (26 directly)

MIT license

61KB
1.5K SLoC

JavaScript 1K SLoC // 0.2% comments Rust 234 SLoC // 0.0% comments TypeScript 109 SLoC // 0.7% comments

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_ops_and_esm() 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

Dependencies

~96MB
~2M SLoC