https://github.com/acacode/kinka-serializy
Integration kinka with serializy
https://github.com/acacode/kinka-serializy
javascript request xmlhttprequest
Last synced: 14 days ago
JSON representation
Integration kinka with serializy
- Host: GitHub
- URL: https://github.com/acacode/kinka-serializy
- Owner: acacode
- License: mit
- Created: 2019-07-21T14:27:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T21:53:26.000Z (almost 6 years ago)
- Last Synced: 2025-10-01T21:33:48.716Z (9 months ago)
- Topics: javascript, request, xmlhttprequest
- Language: JavaScript
- Size: 132 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
kinka + serializy
[](./LICENSE)
[](https://www.npmjs.com/package/kinka-serializy)
[](https://travis-ci.org/acacode/kinka-serializy)
[](https://www.codefactor.io/repository/github/acacode/kinka-serializy/overview/master)
[](http://npm-stat.com/charts.html?package=kinka-serializy)
[](https://bundlephobia.com/result?p=kinka-serializy)
[](https://bundlephobia.com/result?p=kinka-serializy)
⚡️ Integration serializy with kinka ⚡️
## 🚀 Installation
$ npm i -S kinka-serializy
# or using yarn
$ yarn add kinka-serializy
## 📚 Usage
```js
import kinka from 'kinka'
import KinkaSerializy from 'kinka-serializy'
const api = kinka.create({
baseURL: 'https://your-api.com',
middlewares: [
KinkaSerializy
]
})
// ...
const { data } = await api.get('/client/1234', {
model: ClientModel
})
console.log(data) // your serialized client model
```
Also if you want to serialize error messages from server you need to:
```js
const api = kinka.create({
baseURL: 'https://your-api.com',
middlewares: [
KinkaSerializy({
errorModel: YourPrettifiedErrorModel
})
]
})
```
## 📝 License
Licensed under the [MIT License](./LICENSE).