2017-09-11 18:11:45 -07:00
# `slate-plain-serializer`
2016-07-17 15:37:05 -07:00
```js
2017-09-11 18:11:45 -07:00
import Plain from 'slate-plain-serializer'
2016-07-17 15:37:05 -07:00
```
2017-10-27 13:39:06 -07:00
A serializer that converts a Slate [`Value` ](../slate/value.md ) to and from a plain text string.
2016-07-17 15:37:05 -07:00
## Example
```txt
The Slate editor gives you full control over the logic you can add.\n
In its simplest form, when representing plain text, Slate is a glorified < textarea > . But you can augment it to be much more than that.\n
Check out http://slatejs.org for examples!
```
## Methods
### `Plain.deserialize`
2018-02-07 15:58:41 +00:00
2017-10-27 13:39:06 -07:00
`Plain.deserialize(string: String, [options: Object]) => Value`
2016-07-17 15:37:05 -07:00
2017-10-27 13:39:06 -07:00
Deserialize a plain text `string` into a [`Value` ](../slate/value.md ). A series of blocks will be created by splitting the input string on `\n` characters. Each block is given a type of `'line'` .
2016-07-17 15:37:05 -07:00
2017-10-27 13:39:06 -07:00
If you pass `toJSON: true` as an option, the return value will be a JSON object instead of a [`Value` ](../slate/value.md ) object.
2017-02-06 17:28:46 -08:00
2016-07-17 15:37:05 -07:00
### `Plain.serialize`
2018-02-07 15:58:41 +00:00
2017-10-27 13:39:06 -07:00
`Plain.serialize(value: Value) => String`
2016-07-17 15:37:05 -07:00
2017-10-27 13:39:06 -07:00
Serialize a `value` into a plain text string. Each direct child block of the document will be separated by a `\n` character.