1.0.1 • Published 7 years ago

uri-template-literal v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

A small function to format URIs Build Status

uri-template-literal simplifies formatting of URIs with encodeURIComponent through tagged template literals.

Example

import uri from "uri-template-literal";

// /api/search?q=strange%3Fstring%5Cwith%2Funicode%C2%A1
let queryURI = uri`/api/search?q=${"strange?string\\with/unicode¡"}`
fetch(queryURI)
  .then(...)