@fatcherjs/middleware-json 1.2.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/README.md +42 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @fatcherjs/middleware-json
2
+
3
+ A middleware for transform response to JSON
4
+
5
+ ## Install
6
+
7
+ ### NPM
8
+
9
+ ```bash
10
+ >$ npm install @fatcherjs/middleware-json
11
+ ```
12
+
13
+ ### CDN
14
+
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/@fatcherjs/middleware-json/dist/json.min.js"></script>
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { json } from '@fatcherjs/middleware-json';
23
+ import { fatcher } from 'fatcher';
24
+
25
+ fatcher({
26
+ url: '/bar/foo',
27
+ middlewares: [json()],
28
+ payload: {
29
+ bar: 'foo',
30
+ },
31
+ })
32
+ .then(res => {
33
+ console.log(res);
34
+ })
35
+ .catch(err => {
36
+ console.error(error);
37
+ });
38
+ ```
39
+
40
+ ## License
41
+
42
+ [LICENSE](https://github.com/fatcherjs/fatcher/blob/master/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fatcherjs/middleware-json",
3
- "version": "1.2.0",
3
+ "version": "1.4.1",
4
4
  "main": "dist/json.js",
5
5
  "module": "dist/json.esm.js",
6
6
  "browser": "dist/json.min.js",