0.5.0 • Published 8 years ago

ember-jsonld v0.5.0

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

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