mirror of https://github.com/status-im/NimYAML.git
12 lines
296 B
Nim
12 lines
296 B
Nim
import yaml, streams
|
|
type Person = object
|
|
name : string
|
|
age : int32
|
|
|
|
var personList = newSeq[Person]()
|
|
personList.add(Person(name: "Karl Koch", age: 23))
|
|
personList.add(Person(name: "Peter Pan", age: 12))
|
|
|
|
var s = newFileStream("out.yaml", fmWrite)
|
|
jsonDumper().dump(personList, s)
|
|
s.close() |