Skip to content
This repository has been archived by the owner on Feb 6, 2018. It is now read-only.

Latest commit

 

History

History
39 lines (32 loc) · 930 Bytes

README.md

File metadata and controls

39 lines (32 loc) · 930 Bytes

ember-jsonld

An Ember-friendly jsonld.js wrapper.

Installation

ember install ember-jsonld

Usage

import { expand, compact, flatten, frame, toRDF, normalize } from 'ember-jsonld';

expand(json).then(function(expanded) {
  // expansion success
}).catch(function(error) {
  // expansion failure
}).finally(function() {
  // expansion success or failure
});

var hash = Ember.RSVP.hash({
  expanded: expand(json),
  compacted: compact(json, context),
  flattened: flatten(json),
  framed: frame(json, frame),
  nquads: toRDF(json, {format: 'application/nquads'}),
  normalized: normalize(json, {format: 'application/nquads'})
});

Contributing

Installing dependencies and running tests:

npm install && npm test