Ketting 2.0 release
Being fresh out of a job, I had some time to work on a new release of the Ketting library.
The Ketting library is meant to be a generic HATEOAS library for Javascript using a simple, modern API. Currently it only supports the HAL and HTML formats, but I’m curious what other formats folks are interested to see support for.
An example:
const ketting = new Ketting('https://example.org/bookmark');
const author = await ketting.follow('author');
console.log(await author.get());
For the 2.0 release, the biggest change I’ve made is that everything is now converted to TypeScript. TypeScript is so great, I can’t really imagine writing any serious javascript without it anymore.
Most of the sources are also upgraded to use modern javascript features, such
as async
/await
, for...of
loops and const
/let
instead of var
.
A small bonus feature is the addition of the .patch()
method on resoures,
which provides a pretty rudimentary shortcut to doing PATCH
request. I kept
it extremely basic, because I wanted to figure out first how users like to use
this feature first before over-engineering it.
Interested? Go check out the project and documentation on Github, or go download it off npmjs.com.