@dashkite/url-codex

0.1.1 • Public • Published

URL Codex

URL interpolation and destructuring

import { encode, decode } from "@dashkite/url-codex"

data = name: alice

greeting = encode "https://acme.org/greeting/{name}", data

assert greeting == "https://acme.org/greeting/alice"

result = decode "https://acme.org/greeting/{name}",
  "https://acme.org/greeting/alice"

assert.deepEqual result, data
  • Inspired by (but not compliant with) RFC 6570
  • Wildcard and optional parameters
  • Query parameters

Readme

Keywords

none

Package Sidebar

Install

npm i @dashkite/url-codex

Weekly Downloads

1

Version

0.1.1

License

none

Unpacked Size

315 kB

Total Files

33

Last publish

Collaborators

  • dyoder
  • freeformflow