Skip to main content
Deno 2 is finally here 🎉️
Learn more

Deno URI Template

A Typescript implementation of URI Template (RFC6570).

Usage

import { expand } from "https://deno.land/x/deno_uri_template/mod.ts";

expand("{hello}", { hello: "Hello World!" })
// "Hello%20World%21"

expand("{hello:6}", { hello: "Hello World!" })
// "Hello%20"

expand("{/path*}", { path: ["person", "albums" })
// "/person/albums"

expand("{?filter*}", { filter: { firstName: "john", lastName: "doe" } })
// "?firstName=john&lastName=doe"

Tests

$ git clone --recurse-submodules https://github.com/larshisken/deno_uri_template
$ deno test --allow-read