# pack() function · @imqueue/pg-pubsub

Source: https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.pack/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-pubsub 3.0.5 — generated reference, not hand-written

Serializes given input object to JSON string. On error will return serialized null value

**Signature:**

```typescript
export declare function pack(input: AnyJson, logger?: AnyLogger, pretty?: boolean): string;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| input | [AnyJson](https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.anyjson/) | serializable value |
| logger | [AnyLogger](https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.anylogger/) | _(Optional)_ logger to handle errors logging with |
| pretty | boolean | _(Optional)_ serialized format output prettify flag |


**Returns:**

string

