September 27, 2018
October 8, 2018
So browsers have long and rough history regarding making remote requests. XMLHttpRequest is an overly complicated thing, but we had to use it for a long time before a real hero, Fetch API, appeared. Fetch brought us a simple yet powerful tooling for interacting with server API, and now every major browser supports it, so struggle is over. But the sky’s the limit, and Sindre Sorhus made a small library called ky to further simplify and optimize HTTP requests from a client.
There are tons of different libraries, and we often struggle to choose the best suited for us. Or what if we just want to test it and see how it works in real life? We can for sure install it as npm package, include in our bundle and write some lines for it in the code, but it all looks a bit over complicated if we just want to play around a bit. And I’ve always loved library websites like lodash.com, because here you can simply open your DevTools console and test all lodash methods you need because it is already loaded on the page. But now we’ve got a website specifically for this, it’s called hyperConsole. Here you can load any library that exists on cdn.js and it will automatically be loaded into current window scope.