Skip to content

Commit 329966f

Browse files
committed
feat: add prettier
1 parent 4c0e1cd commit 329966f

8 files changed

+1720
-4269
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm exec lint-staged

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README_CN.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
## 介绍
66

7-
`gRPCity` 是一个运行在 Node.js 的 gRPC 微服务库,结合了 `proto-loader``grpc-js`,提供了非常简易的方式去加载 proto 文件,简化了很多难以理解的技术概念,只需要几个函数就可以轻松实现客户端和服务端,同时也提供非常多高级的功能满足大多数开发场景。
7+
`gRPCity` 是一个运行在 Node.js 的 gRPC 微服务库,结合了 `proto-loader`
8+
`grpc-js`,提供了非常简易的方式去加载 proto 文件,简化了很多难以理解的技术概念,
9+
只需要几个函数就可以轻松实现客户端和服务端,同时也提供非常多高级的功能满足大多数
10+
开发场景。
811

9-
> 名字来源于: gRPC + City = gRPCity,寄托了作者希望这个库能支撑了业务城市的建设,以技术底座的视角,让大家聚焦业务,更好地支撑交付。
12+
> 名字来源于: gRPC + City = gRPCity,寄托了作者希望这个库能支撑了业务城市的建
13+
> 设,以技术底座的视角,让大家聚焦业务,更好地支撑交付。
1014
1115
特性如下:
1216

@@ -67,9 +71,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
6771

6872
export default new GrpcLoader({
6973
location: path.join(__dirname, './'),
70-
files: [
71-
'greeter.proto'
72-
]
74+
files: ['greeter.proto']
7375
})
7476
```
7577
@@ -89,7 +91,7 @@ class Greeter {
8991
}
9092
}
9193

92-
const start = async (addr) => {
94+
const start = async addr => {
9395
await loader.init()
9496

9597
const server = loader.initServer()
@@ -107,9 +109,9 @@ start('127.0.0.1:9099')
107109
最后,创建`client.js`, 编写下面的代码到其中:
108110
109111
```js
110-
import loader from "./loader.js"
112+
import loader from './loader.js'
111113

112-
const start = async (addr) => {
114+
const start = async addr => {
113115
await loader.init()
114116

115117
await loader.initClients({
@@ -137,7 +139,6 @@ node ./client.js
137139
138140
可通过访问 [grpcity.js.org](https://grpcity.js.org) 查看完整的文档和示例。
139141
140-
141142
## License
142143
143144
Released under the MIT License.

0 commit comments

Comments
 (0)