>$ npm install @fatcherjs/middleware-json
<script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-json/dist/index.min.js"></script>
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