json-api-reader

json-api-reader JS library on GitHub json-api-reader JS library on npm Download json-api-reader JS library

A basic reader for working with json:api responses.

Version 1.0.0 License ISC
json-api-reader has no homepage
json-api-reader JS library on GitHub
json-api-reader JS library on npm
Download json-api-reader JS library
Keywords
json:apireaderparser

JsonApiReader

This is a small package to simplify reading records from APIs that implement the json:api v1.x format.

See the documentation site for more details.

The primary goal is to unpack response data and produce an output that is easier to navigate.

A complicated (but very efficient) JSON:API response could be converted to something like this:

// An sample article record with relationships.
{
    "id": 123,
    "title": "Some article title",
    "body": "Some long body text",
    "author": {
        "id": 99,
        "firstName": "Clark",
        "lastName": "Kent"
    },
    "comments": [
        {
            "id": 10,
            "content": "First!",
            "author": {
                "id": 100,
                "firstName": "Bruce",
                "lastName": "Wayne"
            }
        }
    ]
}

Hope it helps.