@fatcherjs/middleware-json 3.0.0-alpha-5 → 3.0.0-alpha-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # @fatcher/middleware-json
1
+ # @fatcherjs/middleware-json
2
+
3
+ <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>
4
+ [![install size](https://packagephobia.com/badge?p=@fatcherjs/middleware-json)](https://packagephobia.com/result?p=@fatcherjs/middleware-json)
5
+ <a href="https://unpkg.com/@fatcherjs/middleware-json"><img alt="Size" src="https://img.badgesize.io/https://unpkg.com/@fatcherjs/middleware-json"></a>
2
6
 
3
7
  ## Install
4
8
 
@@ -20,9 +24,13 @@
20
24
  import { fatcher } from 'fatcher';
21
25
  import { json } from '@fatcherjs/middleware-json';
22
26
 
23
- fatcher('https://foo.bar', {
27
+ const res = await fatcher('https://foo.bar/get', {
24
28
  middlewares: [json()],
25
29
  });
30
+
31
+ const streamingJson = await res.readStreamAsJson((string: string, buffer: Uint8Array) => {
32
+ console.log(string, buffer); // chunks for streaming string
33
+ }); // full result
26
34
  ```
27
35
 
28
36
  ## License
package/dist/index.esm.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { readStreamByChunk } from '@fatcherjs/utils-shared';
2
- import 'fatcher';
3
2
 
4
3
  const json = () => {
5
4
  return async (context, next) => {
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var utilsShared = require('@fatcherjs/utils-shared');
6
- require('fatcher');
7
6
 
8
7
  const json = () => {
9
8
  return async (context, next) => {
package/package.json CHANGED
@@ -13,15 +13,15 @@
13
13
  "dist"
14
14
  ],
15
15
  "peerDependencies": {
16
- "fatcher": "3.0.0-alpha-5"
16
+ "fatcher": "3.0.0-alpha-7"
17
17
  },
18
18
  "dependencies": {
19
- "@fatcherjs/utils-shared": "3.0.0-alpha-5"
19
+ "@fatcherjs/utils-shared": "3.0.0-alpha-7"
20
20
  },
21
21
  "devDependencies": {
22
- "fatcher": "3.0.0-alpha-5"
22
+ "fatcher": "3.0.0-alpha-7"
23
23
  },
24
- "version": "3.0.0-alpha-5",
24
+ "version": "3.0.0-alpha-7",
25
25
  "scripts": {
26
26
  "clean": "rimraf dist",
27
27
  "build": "npm run clean && rollup -c rollup.config.ts",