https://github.com/larshisken/deno_uri_template
A Typescript implementation of URI Template (RFC6570)
https://github.com/larshisken/deno_uri_template
deno rfc-6570 typescript uri-template
Last synced: about 2 months ago
JSON representation
A Typescript implementation of URI Template (RFC6570)
- Host: GitHub
- URL: https://github.com/larshisken/deno_uri_template
- Owner: larshisken
- License: mit
- Created: 2021-02-07T16:16:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-29T13:01:12.000Z (about 5 years ago)
- Last Synced: 2025-08-29T08:07:58.018Z (10 months ago)
- Topics: deno, rfc-6570, typescript, uri-template
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deno URI Template
A Typescript implementation of URI Template ([RFC6570](https://tools.ietf.org/html/rfc6570)).
## Usage
```typescript
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
```bash
$ git clone --recurse-submodules https://github.com/larshisken/deno_uri_template
$ deno test --allow-read
```