# elide-jsonapi-client **Repository Path**: myblack/elide-jsonapi-client ## Basic Information - **Project Name**: elide-jsonapi-client - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-16 - **Last Updated**: 2021-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: 快速开发 ## README # Elide JSON API Client [![npm](https://flat.badgen.net/npm/v/elide-jsonapi-client)](https://www.npmjs.com/package/elide-jsonapi-client) [![npm](https://flat.badgen.net/npm/dt/elide-jsonapi-client)](https://www.npmjs.com/package/elide-jsonapi-client) [![gzip size](https://flat.badgen.net/bundlephobia/minzip/elide-jsonapi-client)](https://bundlephobia.com/result?p=elide-jsonapi-client) [![code coverage](https://flat.badgen.net/coveralls/c/github/nerdstep/elide-jsonapi-client)](https://coveralls.io/github/nerdstep/elide-jsonapi-client) [![maintainability](https://flat.badgen.net/codeclimate/maintainability/nerdstep/elide-jsonapi-client)](https://codeclimate.com/github/nerdstep/elide-jsonapi-client) [![build status](https://flat.badgen.net/travis/nerdstep/elide-jsonapi-client)](https://travis-ci.org/nerdstep/elide-jsonapi-client) [![styled with prettier](https://flat.badgen.net/badge/styled%20with/prettier/pink)](https://github.com/prettier/prettier) [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) [![license](https://flat.badgen.net/github/license/nerdstep/elide-jsonapi-client)](./LICENSE) > An opinionated [{json:api}](http://jsonapi.org) client for [Elide](http://elide.io) based APIs There are already a number of client libraries for working with JSON API, however this library is specifically designed for interacting with Elide based APIs, which has a few of it's own unique characteristics. ## Features - Built with Typescript! - Built on top of [axios](https://github.com/axios/axios) as a peer dependency - Supports `Promises` and `async/await` - JSON API response normalization - Flatter structure - Merges included relationship data - Serializes normalized resources back to a JSON API structure - Dates are converted to Unix epoch time for Elide - Protected fields can be omitted from being sent to the API - Supports [JSON Patch Extension](https://github.com/json-api/json-api/blob/9c7a03dbc37f80f6ca81b16d444c960e96dd7a57/extensions/jsonpatch/index.md) for bulk writes and complex mutations - Parameter serialization - Fields, filter, include, sort - [Pagination](http://elide.io/pages/guide/10-jsonapi.html#pagination): `size` & `number` OR `offset` & `limit` - Request caching and throttling ## Basic Usage ```js import ApiClient from 'elide-jsonapi-client' // Initialize a new client const api = new ApiClient({ baseURL: 'http://localhost/api', }) // Fetch a resource collection const res = await api.fetch('articles') // Create a resource api.create('articles', { type: 'articles', title: 'Hello World', }) // Update a resource api.update('articles/1', { id: '1', type: 'articles', title: 'Hello World!!!', }) // Remove a resource api.remove('articles', 1) ``` ## Documentation ### [API Docs](https://nerdstep.github.io/elide-jsonapi-client) ### [Wiki](https://github.com/nerdstep/elide-jsonapi-client/wiki) ## Credits Inspired by [Kitsu](https://github.com/wopian/kitsu/tree/master/packages/kitsu) ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Ken White

⚠️ 💻
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! See [CONTRIBUTING](./CONTRIBUTING.md) guidelines. ## License [MIT](./LICENSE)