# server.Server.setBuffer

- **Module:** server.Server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/server.ts#L898
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-setbuffer/

```
server.Server.setBuffer(name: : string, data: : string) -> Promise<void>
```

Put a string into a named paste buffer.

Empty data stores nothing. tmux exits zero for `set-buffer -b name ""` and
creates no buffer at all, so the name a caller thinks they just wrote is
absent — and they learn that from whatever reads it next, which points at
the wrong call. Check before storing content that may be empty.

## Example

```ts
await server.setBuffer("greeting", "hello");
```
