1- # h3-compress
1+ # h3-compression
22
33[ ![ npm version] [ npm-version-src ]] [ npm-version-href ]
44[ ![ npm downloads] [ npm-downloads-src ]] [ npm-downloads-href ]
2020
2121``` bash
2222# Using npm
23- npm install h3-compress
23+ npm install h3-compression
2424
2525# Using yarn
26- yarn add h3-compress
26+ yarn add h3-compression
2727
2828# Using pnpm
29- pnpm add h3-compress
29+ pnpm add h3-compression
3030```
3131
3232## Usage
3333
3434``` ts
3535import { createServer } from ' node:http'
3636import { createApp , eventHandler , toNodeListener } from ' h3'
37- import { useCompressionStream } from ' h3-compress '
37+ import { useCompressionStream } from ' h3-compression '
3838
3939const app = createApp ({ onBeforeResponse: useCompressionStream }) // or { onBeforeResponse: useCompression }
4040app .use (
@@ -50,7 +50,7 @@ Example using <a href="https://github.com/unjs/listhen">listhen</a> for an elega
5050``` ts
5151import { createApp , eventHandler , toNodeListener } from ' h3'
5252import { listen } from ' listhen'
53- import { useCompressionStream } from ' h3-compress '
53+ import { useCompressionStream } from ' h3-compression '
5454
5555const app = createApp ({ onBeforeResponse: useCompressionStream }) // or { onBeforeResponse: useCompression }
5656app .use (
@@ -67,7 +67,7 @@ If you want to use it in nuxt 3 you can define a nitro plugin. But there only th
6767Create a new file in ` server/plugins/compression.ts `
6868
6969```` ts
70- import { useCompression } from ' h3-compress '
70+ import { useCompression } from ' h3-compression '
7171
7272export default defineNitroPlugin ((nitro ) => {
7373 nitro .hooks .hook (' render:response' , async (response , { event }) => {
@@ -111,13 +111,13 @@ H3 has a concept of composable utilities that accept `event` (from `eventHandler
111111
112112<!-- Badges -->
113113
114- [ npm-version-src ] : https://img.shields.io/npm/v/h3-compress ?style=flat&colorA=080f12&colorB=1fa669
115- [ npm-version-href ] : https://npmjs.com/package/h3-compress
116- [ npm-downloads-src ] : https://img.shields.io/npm/dm/h3-compress ?style=flat&colorA=080f12&colorB=1fa669
117- [ npm-downloads-href ] : https://npmjs.com/package/h3-compress
118- [ bundle-src ] : https://img.shields.io/bundlephobia/minzip/h3-compress ?style=flat&colorA=080f12&colorB=1fa669&label=minzip
119- [ bundle-href ] : https://bundlephobia.com/result?p=h3-compress
120- [ license-src ] : https://img.shields.io/github/license/CodeDredd/h3-compress .svg?style=flat&colorA=080f12&colorB=1fa669
121- [ license-href ] : https://github.com/CodeDredd/h3-compress /blob/main/LICENSE
114+ [ npm-version-src ] : https://img.shields.io/npm/v/h3-compression ?style=flat&colorA=080f12&colorB=1fa669
115+ [ npm-version-href ] : https://npmjs.com/package/h3-compression
116+ [ npm-downloads-src ] : https://img.shields.io/npm/dm/h3-compression ?style=flat&colorA=080f12&colorB=1fa669
117+ [ npm-downloads-href ] : https://npmjs.com/package/h3-compression
118+ [ bundle-src ] : https://img.shields.io/bundlephobia/minzip/h3-compression ?style=flat&colorA=080f12&colorB=1fa669&label=minzip
119+ [ bundle-href ] : https://bundlephobia.com/result?p=h3-compression
120+ [ license-src ] : https://img.shields.io/github/license/CodeDredd/h3-compression .svg?style=flat&colorA=080f12&colorB=1fa669
121+ [ license-href ] : https://github.com/CodeDredd/h3-compression /blob/main/LICENSE
122122[ jsdocs-src ] : https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
123- [ jsdocs-href ] : https://www.jsdocs.io/package/h3-compress
123+ [ jsdocs-href ] : https://www.jsdocs.io/package/h3-compression
0 commit comments