# IMQOptions.compressAbove property · @imqueue/core

Source: https://imqueue.org/api/core/latest/core.imqoptions.compressabove/
Published: 2026-11-12
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/core 3.6.0 — generated reference, not hand-written

Compress a queue message with zstd when its JSON is longer than this many characters. `0`, the default, never does. Read from `IMQ_COMPRESS_ABOVE` when not given.

**Signature:**

```typescript
compressAbove?: number;
```

## Remarks

Unlike [IMQOptions.useGzip](https://imqueue.org/api/core/latest/core.imqoptions.usegzip/) it need not agree between producer and consumer: every queue reads plain, gzipped and zstd messages alike. Turn it on only once every consumer runs a version that reads zstd, and on Node 22.15 or later; an older Node writes plain JSON whatever it says. [IMQOptions.useGzip](https://imqueue.org/api/core/latest/core.imqoptions.usegzip/) wins where both are set. Applies to queue messages only, not to [IMessageQueue.publish()](https://imqueue.org/api/core/latest/core.imessagequeue.publish/).

