---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# WritableStream.getWriter()

The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance.
While the stream is locked, no other writer can be acquired until this one is released.

## Syntax

```js
getWriter()
```

### Parameters

None.

### Return value

A `WritableStreamDefaultWriter` object instance.

### Exceptions

- `TypeError`
  - : The stream you are trying to create a writer for is not a `WritableStream`.
