# Write JSON
When compiled with feature `io_json`, you can use this crate to write JSON.
The following example writes an array to JSON:
```rust
{{#include ../../../examples/json_write.rs}}
```
Likewise, you can also use it to write to NDJSON:
```rust
{{#include ../../../examples/ndjson_write.rs}}
```