0.1.3-a2 • Published 7 years ago
heracles v0.1.3-a2
heracles
Hydra Core library for JavaScript
Heracles is a Promise-based library for consuming Hydra APIs
Browser support
You will need polyfills for older browsers:
Chrome | Firefox | IExplore | Edge | Safari | Opera | |
---|---|---|---|---|---|---|
window.fetch | <42 | <39 | <=11 | <14 | <=10 | <29 |
WeakMap | <36 | <6 | <11 | <7.1 | <23 |
Heracles also uses some ES6 functions from the Object
and Array
prototypes. You may have to load polyfills like those
of the core-js package:
import 'core-js/es6/object';
import 'core-js/es6/array';
Installation
Heracles uses JSPM for development and is probably best used with it:
jspm install npm:heracles
However, it is also possible to install from NPM directly.
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
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;
});
More examples
License
MIT
0.1.3-a2
7 years ago
0.1.3-a1
7 years ago
0.1.2
7 years ago
0.1.2-pre04
7 years ago
0.1.2-pre03
7 years ago
0.1.2-pre02
7 years ago
0.1.2-pre01
8 years ago
0.1.1
8 years ago
0.0.1
8 years ago