@fatcherjs/middleware-json
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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

Dependencies (0)

    Dev Dependencies (17)

    Package Sidebar

    Install

    npm i @fatcherjs/middleware-json

    Weekly Downloads

    2

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    5.92 kB

    Total Files

    7

    Last publish

    Collaborators

    • fanhaoyuan