0.2.3 • Published 10 years ago

halpert v0.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Halpert

Build Status

Halpert is a library for representing and interfacing with hypermedia formats. It provides a way for converting to and from these formats, along with methods for filtering and parsing through them in a general way.

Install

Use npm to install halpert.

npm install halpert

Supported Formats

  • HAL+JSON - Currently only parses HAL objects

Usage

Initializing and Registering Formats

To initialize a Halpert object and register the formats, require the halpert package along with any formats desired. The example below includes the HAL+JSON format.

var Halpert = require('halpert'),
    halJson = require('halpert-hal-json');

halpert = new Halpert;
halpert.registerFormat(halJson);

Representing Documents

Once you have a Halpert object like above, you can then start representing documents.

var doc = {
  _links: { self: { href: "/customer/4" }},
  full_name: "John Doe",
  email: "john@doe.com"
}

represnter = halpert.represent(doc, 'application/hal+json');

Contributing

  • Please make sure all contributions are covered by tests
  • Run gulp build once all changes are complete
0.2.3

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago