1.0.1 • Published 7 years ago
uri-template-literal v1.0.1
A small function to format URIs
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(...)