Skip to content

Commit 8c1384f

Browse files
committed
Update README.md
1 parent f470a77 commit 8c1384f

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ console.log(xml);
3737

3838
```xml
3939
<row>
40-
<color>red</color>
41-
<maxSpeed>120</maxSpeed>
42-
<age>2</age>
40+
<color>red</color>
41+
<maxSpeed>120</maxSpeed>
42+
<age>2</age>
4343
</row>
4444
<row>
45-
<color>blue</color>
46-
<maxSpeed>150</maxSpeed>
47-
<age>4</age>
45+
<color>blue</color>
46+
<maxSpeed>150</maxSpeed>
47+
<age>4</age>
4848
</row>
4949
```
5050

@@ -80,3 +80,20 @@ Takes string containing CSV data and returns string containing equivalent XML da
8080

8181
Type: `boolean`\
8282
Default: `true`
83+
84+
- `indentation`: Number of spaces used to indent the XML output. A string like `\t` or `' '` can also be passed.
85+
86+
Type: `number | string`\
87+
Default: `4`
88+
89+
- `quotes`: If a column contains the separator character, you can use a quote charactor to wrap the column content, e.g., "Coding, Beauty" won't be split into two columns during parsing.
90+
91+
Type: `single | double | all | none | RegExp`
92+
93+
- `single`: use single quotes
94+
- `double`: use double quotes
95+
- `all`: use single and double quotes
96+
- `none`: ignore quotes - treat as part of CSV
97+
- `RegExp`: custom regex pattern, e.g., `/[\(|\)]/` for column enclosed with `(` and `)`.
98+
99+
Default: `'none'`

0 commit comments

Comments
 (0)