Skip to content

hekar/hal-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hal-builder

A fluent Hal hypermedia representation builder.

Based on Siren Builder.

Limitations

  • Does not include support for curies, as I have not found a use case for such feature support

Oddities

  • 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();

// ...

Installation

$ npm install -S hal-builder

About

Fluent NodeJS hal hypermedia builder

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published