> For the complete documentation index, see [llms.txt](https://socket.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://socket.gitbook.io/docs/3-ke-hu-duan-apiclientapi/3.3-socket/socket_compress_value.md).

# 3.3.9 socket.compress(value)

* `value` (Boolean)
* **Returns** `Socket`

为后续事件发送设置一个修饰符，该修饰符只在值为`true`时压缩事件数据。不调用方法时默认为`true`。

```javascript
socket.compress(false).emit('an event',{some:"data"});
```
