199 breaking releases

new 0.202.0 Apr 18, 2025
0.200.0 Apr 11, 2025
0.197.0 Mar 28, 2025
0.184.0 Dec 19, 2024
0.2.0 Mar 21, 2021

#996 in HTTP server

Download history 1861/week @ 2024-12-27 3222/week @ 2025-01-03 5435/week @ 2025-01-10 5604/week @ 2025-01-17 5557/week @ 2025-01-24 4800/week @ 2025-01-31 5315/week @ 2025-02-07 5517/week @ 2025-02-14 6193/week @ 2025-02-21 6301/week @ 2025-02-28 4109/week @ 2025-03-07 5069/week @ 2025-03-14 5293/week @ 2025-03-21 4636/week @ 2025-03-28 4478/week @ 2025-04-04 4327/week @ 2025-04-11

19,504 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

~96MB
~2M SLoC