Skip to content

Commit 1dbdf74

Browse files
committed
Update README
1 parent a03ce3e commit 1dbdf74

4 files changed

Lines changed: 47 additions & 10 deletions

File tree

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- master
7+
path-ignore:
8+
- 'README.md'
79
release:
810
types: [published]
911

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- master
77
path-ignore:
8-
- 'README.rst'
8+
- 'README.md'
99
release:
1010
types: [published]
1111

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Deser
2+
3+
**Deser is a serialization and deserialization library for Nim**
4+
5+
[Deser documentation](https://deser.nim.town/)
6+
7+
## Installation
8+
9+
```
10+
nimble install deser
11+
```
12+
13+
or
14+
15+
```nim
16+
requires "nim >= 1.4.2, deser >= 0.1.3"
17+
```
18+
19+
## Usage
20+
21+
```nim
22+
import macros, options, times
23+
import deser, deser_json
24+
25+
type
26+
Foo {.skipSerializeIf(isNone), renameAll(rkSnakeCase).} = object
27+
id: int
28+
someOption: Option[int]
29+
date {.serializeWith(toUnix), deserializeWith(fromUnix).}: Time
30+
31+
const js = """
32+
{
33+
"id": 123,
34+
"some_option": 321,
35+
"date": 1214092800
36+
}
37+
"""
38+
39+
var f = js.parse().to(Foo)
40+
41+
f.someOption = none(int)
42+
43+
assert f.dumps() == """{"id":123,"date":1214092800}"""
44+
```

README.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)