jsonapi-model-formatter
v0.1.14
Published
JSON API formatter for dovima models.
Downloads
6
Keywords
Readme
Jsonapi-model-formatter.js
JSON API formatter for dovima models.
import JsonApiModelFormatter from "jsonapi-model-formatter";
import Model from "dovima";
Model.jsonFormatter = JsonApiModelFormatter; //so now, when you do toJSON on dovima models, you got a jsonapi-compliant model
Quality and Compatibility
Every build and release is automatically tested on the following platforms:
If your platform is not listed above, you can test your local environment for compatibility by copying and pasting the following commands into your terminal:
npm install jsonapi-model-formatter
cd node_modules/jsonapi-model-formatter
gulp test-local
Installation
Copy and paste the following command into your terminal to install Jsonapi-model-formatter:
npm install jsonapi-model-formatter --save
Import / Require
// ES6
import jsonApiModelFormatter from "jsonapi-model-formatter";
// ES5
var jsonApiModelFormatter = require("jsonapi-model-formatter");
// Require.js
define(["require"] , function (require) {
var jsonApiModelFormatter = require("jsonapi-model-formatter");
});
Getting Started
The usage on the top of this file is pretty much all you need to do right now, it works like a formatter middleware for dovima models.
How to Contribute
See something that could use improvement? Have a great feature idea? We listen!
You can submit your ideas through our issues system, or make the modifications yourself and submit them to us in the form of a GitHub pull request.
We always aim to be friendly and helpful.
Running Tests
It's easy to run the test suite locally, and highly recommended if you're using Jsonapi-model-formatter.js on a platform we aren't automatically testing for.
npm test