@fatcherjs/middleware-json
v3.0.0-alpha-11
Published
<a href="https://npmjs.com/package/@fatcherjs/middleware-json"><img src="https://img.shields.io/npm/v/@fatcherjs/middleware-json.svg" alt="npm package"></a> [](https://packagepho
Readme
@fatcherjs/middleware-json
Install
NPM
>$ npm install @fatcherjs/middleware-jsonCDN
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-json/dist/index.min.js"></script>Usage
import { fatcher } from 'fatcher';
import { json } from '@fatcherjs/middleware-json';
const res = await fatcher('https://foo.bar/get', {
middlewares: [json],
});
const streamingJson = await res.readStreamAsJson((string: string, buffer: Uint8Array) => {
console.log(string, buffer); // chunks for streaming string
}); // full result