A lightweight json-api client addon for superagent
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
__tests__
.gitignore
LICENSE
README.md
browser.js
common.js
index.js
package.json

README.md

superagent-jsonapify

NPM

Dependencies

A lightweight json-api client addon for superagent. If you don't know about jsonapify or the JSON-API format, you should have a look.

Usage

ES2015 style

import superagent from 'superagent';
import superagentJsonapify from 'superagent-jsonapify';

superagentJsonapify(superagent);

const request = superagent.get('/api/videos?include=comments')
  .then(function(response) {
    const body = response.body;
    const video = body.data[0];
    const comments = video.comments;
  });