205 breaking releases

new 0.208.0 Jun 23, 2025
0.206.0 May 29, 2025
0.197.0 Mar 28, 2025
0.184.0 Dec 19, 2024
0.2.0 Mar 21, 2021

#1240 in HTTP server

Download history 5835/week @ 2025-03-03 4343/week @ 2025-03-10 5443/week @ 2025-03-17 4383/week @ 2025-03-24 4734/week @ 2025-03-31 4531/week @ 2025-04-07 4935/week @ 2025-04-14 4732/week @ 2025-04-21 3606/week @ 2025-04-28 2951/week @ 2025-05-05 3600/week @ 2025-05-12 3697/week @ 2025-05-19 4492/week @ 2025-05-26 4356/week @ 2025-06-02 4646/week @ 2025-06-09 4278/week @ 2025-06-16

17,893 downloads per month
Used in 67 crates (28 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() 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