Skip to content

Commit a80da7a

Browse files
committed
docs: Update readme
1 parent 023817f commit a80da7a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# h3-compression
1+
# H3-compression
22

33
[![npm version][npm-version-src]][npm-version-href]
44
[![npm downloads][npm-downloads-src]][npm-downloads-href]
55
[![bundle][bundle-src]][bundle-href]
66
[![JSDocs][jsdocs-src]][jsdocs-href]
77
[![License][license-src]][license-href]
88

9+
> Handles compression for H3
10+
911
## Features
1012

11-
✔️  **Zlib Compressions:** You can use zlib compression (brotli, gzip and deflate)
13+
✔️  **Zlib Compression:** You can use zlib compression (brotli, gzip and deflate)
1214

1315
✔️  **Stream Compression:** You can use native stream compressions (gzip, deflate)
1416

@@ -61,11 +63,11 @@ app.use(
6163
listen(toNodeListener(app))
6264
```
6365

64-
## Nuxt 3 Usage
66+
## Nuxt 3
6567

66-
If you want to use it in nuxt 3 you can define a nitro plugin. But there only the Zlib compression works
67-
Create a new file in `server/plugins/compression.ts`
68+
If you want to use it in nuxt 3 you can define a nitro plugin.
6869

70+
`server/plugins/compression.ts`
6971
````ts
7072
import { useCompression } from 'h3-compression'
7173

@@ -78,10 +80,12 @@ export default defineNitroPlugin((nitro) => {
7880
})
7981
})
8082
````
83+
> [!NOTE]
84+
> `useCompressionStream` doesn't work right now in nitro. So you just can use `useCompression`
8185
8286
## Utilities
8387

84-
H3 has a concept of composable utilities that accept `event` (from `eventHandler((event) => {})`) as their first argument and `response` as their second.
88+
H3-compression has a concept of composable utilities that accept `event` (from `eventHandler((event) => {})`) as their first argument and `response` as their second.
8589

8690
#### Zlib Compression
8791

@@ -104,6 +108,10 @@ H3 has a concept of composable utilities that accept `event` (from `eventHandler
104108
</a>
105109
</p>
106110

111+
## Releated Projects
112+
113+
- [H3](https://github.com/unjs/h3)
114+
107115
## License
108116

109117
[MIT](./LICENSE) License © 2023-PRESENT [Gregor Becker](https://github.com/CodeDredd)

0 commit comments

Comments
 (0)