# LibTmux.Codec.decode_field/3

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/codec.ex#L22
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-codec-decode_field-3/

```
decode_field(response, type, options \\ [])
@spec decode_field(binary(), :bytes | :string, [
        field_option()
      ]) ::
        {:ok, binary()} | {:error, LibTmux.Error.t()}

decode_field(response, type, options \\ [])
@spec decode_field(binary(), :integer, [field_option()]) ::
        {:ok, integer()} | {:error, LibTmux.Error.t()}

decode_field(response, type, options \\ [])
@spec decode_field(binary(), :boolean, [field_option()]) ::
        {:ok, boolean()} | {:error, LibTmux.Error.t()}
```

Removes one framing newline and validates the complete field value.

See the [worked example](api-examples.html#encoding-and-protocol).

## Parameters

- `response` (`binary()`)
- `type` (`:bytes | :string`) (for `decode_field/3(response, type, options) [overload 1]`)
- `options` (`[field_option()]`)
- `type` (`:integer`) (for `decode_field/3(response, type, options) [overload 2]`)
- `type` (`:boolean`) (for `decode_field/3(response, type, options) [overload 3]`)
