uri-template-literal
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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(...)

/uri-template-literal/

    Package Sidebar

    Install

    npm i uri-template-literal

    Weekly Downloads

    5

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • vasachi