1 | # @36node/query-normalizr
|
2 |
|
3 | [![version][0]][1] [![downloads][2]][3]
|
4 |
|
5 | query-normalizr 的作用: 将 url 中的 query 规则化成方便 service 层调用的数据格式。
|
6 |
|
7 | 我们定义了:
|
8 |
|
9 | 1. [标准的 query in url 格式](../tpl-service/README.md##QueryInRoute).
|
10 | 2. [标准的 service 层 Query 数据格式](../tpl-service/README.md##QueryInService).
|
11 |
|
12 | ## Install
|
13 |
|
14 | ```bash
|
15 | yarn add query-normalizr
|
16 | ```
|
17 |
|
18 | ## Usage
|
19 |
|
20 | ```js
|
21 | import normalizr from "@36node/query-normalizr";
|
22 |
|
23 | // koa app
|
24 | app.use(normalizr(options));
|
25 | ```
|
26 |
|
27 | ## API
|
28 |
|
29 | ```js
|
30 | normalizr(options);
|
31 | ```
|
32 |
|
33 | return koa middleware
|
34 |
|
35 | ## Contributing
|
36 |
|
37 | 1. Fork it!
|
38 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
39 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
40 | 4. Push to the branch: `git push origin my-new-feature`
|
41 | 5. Submit a pull request :D
|
42 |
|
43 | ## Author
|
44 |
|
45 | **query-normalizr** © [36node](https://github.com/36node), Released under the [MIT](./LICENSE) License.
|
46 |
|
47 | Authored and maintained by 36node with help from contributors ([list](https://github.com/36node/query-normalizr/contributors)).
|
48 |
|
49 | > [github.com/zzswang](https://github.com/zzswang) · GitHub [@36node](https://github.com/36node) · Twitter [@y](https://twitter.com/y)
|
50 |
|
51 | [0]: https://img.shields.io/npm/v/@36node/query-normalizr.svg?style=flat
|
52 | [1]: https://npmjs.com/package/@36node/query-normalizr
|
53 | [2]: https://img.shields.io/npm/dm/@36node/query-normalizr.svg?style=flat
|
54 | [3]: https://npmjs.com/package/@36node/query-normalizr
|