aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2018-10-18 09:06:42 +0200
committerache <ache@ache.one>2018-10-18 09:06:42 +0200
commit83363c9c24e846491b7f546f20365e7afe1b5359 (patch)
tree2f1cf0bc22740d551e8ac8a15b4b22dd2da31b13
parentUpdate dist package (diff)
Add some documentation
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 960b809..e5ec252 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,22 @@ parseAttr('{ width=500px editable=true #unicorn .dangerous .cute }');
}
```
+### Advanced usage
+
+The parsing can start at a positive offset.
+
+```js
+parseAttr('SYNTAX{ width=500px editable=true }', len('SYNTAX'));
+```
+
+A configuration can also be specified, actualy, there is only one configuration option.
+The default value of key without value.
+
+```js
+parseAttr('{ width=500px editable }', 0, {defaultValue: true});
+// or
+parseAttr('{ width=500px editable }', 0, {defaultValue: key => 'NO_VALUE_FOR_'+key.toUpperCase()});
+```
## Licence