@fatcherjs/middleware-json

A fatcher middleware for transforming stream into json


Keywords
fatcher, middleware, json
License
MIT
Install
npm install @fatcherjs/middleware-json@2.0.0

Documentation

@fatcherjs/middleware-json

A middleware for transform response to JSON

codecov install size Size npm package build status

Install

NPM

>$ npm install @fatcherjs/middleware-json

CDN

<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-json/dist/json.min.js"></script>

Usage

import { json } from '@fatcherjs/middleware-json';
import { fatcher } from 'fatcher';

fatcher({
    url: '/bar/foo',
    middlewares: [json()],
    body: {
        bar: 'foo',
    },
})
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(error);
    });

License

LICENSE