Skip to content

fatcherjs/middleware-json

Repository files navigation

@fatcherjs/middleware-json

Install

NPM

>$ npm install @fatcherjs/middleware-json

CDN

<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

License

MIT

About

@fatcher/middleware-json

Resources

License

Stars

Watchers

Forks

Packages

No packages published