Skip to content

Library to deserialise JSONAPI responses to plain javascript objects.

License

Notifications You must be signed in to change notification settings

CancerRxGene/deserialise-jsonapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deserialise-jsonapi

Javascript library to deserialise JSONAPI responses to plain javascript objects. Designed to work with the output of Flask-REST-JSONAPI.

Main Features

  • Resolves Nested Includes
  • Asynchronous - Returns a Promise
  • ES6 codebase

Installation

Using npm:

$ npm install --save deserialise-jsonapi

Usage

import Deserialiser from 'deserialise-jsonapi'

const des = new Deserialiser()

let response = fetch('http://your-jsonapi.com/url')
    .then(response => response.json())
    .then(data => des.deserialise(data))
    .then(models => {
        // Use your deserialised models
        console.log(models)
    })

Status

This package should be considered early beta. Though it is used on multiple production websites, the api could still change without warning.

version 0.1.2

About

Library to deserialise JSONAPI responses to plain javascript objects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published