201 breaking releases

0.204.0 Apr 30, 2025
0.202.0 Apr 18, 2025
0.197.0 Mar 28, 2025
0.184.0 Dec 19, 2024
0.2.0 Mar 21, 2021

#1271 in HTTP server

Download history 5395/week @ 2025-01-18 5766/week @ 2025-01-25 4913/week @ 2025-02-01 5242/week @ 2025-02-08 5224/week @ 2025-02-15 6523/week @ 2025-02-22 5963/week @ 2025-03-01 4255/week @ 2025-03-08 5553/week @ 2025-03-15 4656/week @ 2025-03-22 4606/week @ 2025-03-29 4595/week @ 2025-04-05 4881/week @ 2025-04-12 4503/week @ 2025-04-19 3776/week @ 2025-04-26 2737/week @ 2025-05-03

16,688 downloads per month
Used in 67 crates (27 directly)

MIT license

49KB
1K SLoC

JavaScript 1K SLoC // 0.2% comments Rust 223 SLoC // 0.0% comments TypeScript 8 SLoC // 0.3% 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

~97MB
~2M SLoC