Hydra Core hypermedia-aware client library
npm install heraclesObject and Array prototypes. You may have to load polyfills like those
js
import 'core-js/es6/object';
import 'core-js/es6/array';
`
Installation
Heracles uses JSPM for development and is probably best used with it:
` bash
jspm install npm:heracles
`
However, it is also possible to install from NPM directly.
` bash
npm install heracles
`
Heracles is bundled as a CommonJS module and has been verified to work fine with Webpack. Please let me know if you have any issues
with other tools like Browserify, server-side NodeJS, etc.
Usage
` js
import {Hydra} from 'heracles';
Hydra.loadResource('http://example.com/resource')
.then(res => {
// contains supported classes, operations, etc.
var apiDocs = res.apiDocumentation;
// same as res['@id']
var id = res.id;
});
``