<commit_before>#HALbert
[![Build Status](https://travis-ci.org/xcambar/halbert.png?branch=master)](https://travis-ci.org/xcambar/halbert)
[![Code Climate](https://codeclimate.com/github/xcambar/halbert.png)](https://codeclimate.com/github/xcambar/halbert)

> HAL stands for Hypermedia Application Language. It proposes a media type for representing resources and their relations with hyperlinks.

This JS implementation is for the `HAL-JSON` variant, having the media type `application/hal+json`.

## HAL Status

HAL-JSON is currently at its 5th revision as an Internet Draft at the IETF, and can be read [here](http://tools.ietf.org/html/draft-kelly-json-hal-05).

## HALbert compliance with HAL

This Javascript implementation has been made to be _mostly_ compliant with the current draft. The divergences with the draft being:

* `_links_` is still optional to a Resource, but if present, it MUST contain a `self` entry
* Validation of templated URIs has not been implemented.

# Installation

## Node.js

Install it via NPM:

    npm install halbert

Then in your code

    var parser = require('halbert').parser;

## Browser

You can build `halbert` by using [browserify](http://github.com/substack/node-browserify).

    %ROOT_PATH%/node_modules/browserify/bin/cmd.js index.js --standalone halbert

The generated file will be [UMD](https://github.com/umdjs/umd)-compatible, which means:

* If you use it in an AMD application, HALbert will be available by doing `require('halbert')`.
* Otherwise, il will be available as `window.halbert`

# Usage

Simply execute

    var resource = parser(json_object)

If for any reason, the `json_object` does not describe a valid HAL Resource, an Error will be thrown.

# Roadmap

* Add examples for various situations (Node.js, Express, Ember, Angular, Backbone...)
* Extend the scope to make it a writer of HAL Resources as well as a parser.
* Better code documentation
<commit_msg>Fix typo<commit_after>#HALbert
[![Build Status](https://travis-ci.org/xcambar/halbert.png?branch=master)](https://travis-ci.org/xcambar/halbert)
[![Code Climate](https://codeclimate.com/github/xcambar/halbert.png)](https://codeclimate.com/github/xcambar/halbert)

> HAL stands for Hypermedia Application Language. It proposes a media type for representing resources and their relations with hyperlinks.

This JS implementation is for the `HAL-JSON` variant, having the media type `application/hal+json`.

## HAL Status

HAL-JSON is currently at its 5th revision as an Internet Draft at the IETF, and can be read [here](http://tools.ietf.org/html/draft-kelly-json-hal-05).

## HALbert compliance with HAL

This Javascript implementation has been made to be _mostly_ compliant with the current draft. The divergences with the draft being:

* `_links_` is still optional to a Resource, but if present, it MUST contain a `self` entry
* Validation of templated URIs has not been implemented.

# Installation

## Node.js

Install it via NPM:

    npm install halbert

Then in your code

    var parser = require('halbert').parser;

## Browser

You can build `halbert` by using [browserify](http://github.com/substack/node-browserify).

    %ROOT_PATH%/node_modules/browserify/bin/cmd.js index.js --standalone halbert

The generated file will be [UMD](https://github.com/umdjs/umd)-compatible, which means:

* If you use it in an AMD application, HALbert will be available by doing `require('halbert')`.
* Otherwise, it will be available as `window.halbert`

# Usage

Simply execute

    var resource = parser(json_object)

If for any reason, the `json_object` does not describe a valid HAL Resource, an Error will be thrown.

# Roadmap

* Add examples for various situations (Node.js, Express, Ember, Angular, Backbone...)
* Extend the scope to make it a writer of HAL Resources as well as a parser.
* Better code documentation

{'fraction_non_alphanumeric': 0.0976877110937906, 'fraction_numerical': 0.001558846453624318, 'mean_word_length': 4.46875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6827473', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1118, 'n_words': 437}