/urrl

Create an unfinished URL.

Primary LanguageJavaScript

Urrl

Create an unfinished URL.

Usage

const POKEMON_URRL = new Urrl("http://pokeapi.co/api/v2/pokemon/{name}")
window.fetch(POKEMON_URRL({"name": "bulbasaur"})) // http://pokeapi.co/api/v2/pokemon/bulbasaur
window.fetch(POKEMON_URRL({"name": "squirtle"})) // http://pokeapi.co/api/v2/pokemon/squirtle
window.fetch(POKEMON_URRL({"name": "charmander"})) // http://pokeapi.co/api/v2/pokemon/charmander