A fluent Hal hypermedia representation builder.
Based on Siren Builder.
- Does not include support for curies, as I have not found a use case for such feature support
- Has the notion of "actions" from Siren, which maybe removed from this library pending a major version release
const Hal = require('hal-builder');
const entity = Hal.entity()
.addClass('home')
.addProperty('version', '2.4.1')
.addProperty('health', 'green')
.addLink('self', Hal.link()
.setHref('https://api.example.org/'));
const hal = entity.toJSON();
// ...
$ npm install -S hal-builder