|
5 | 5 | # CSV Writer |
6 | 6 |
|
7 | 7 | Convert objects/arrays into a CSV string or write them into a file. |
| 8 | +It respects [RFC 4180](https://tools.ietf.org/html/rfc4180) for the output CSV format. |
8 | 9 |
|
9 | 10 | ## Prerequisite |
10 | 11 |
|
@@ -133,6 +134,10 @@ console.log(csvStringifier.stringifyRecords(records)); |
133 | 134 | Array of objects (`id` and `title` properties) or strings (field IDs). |
134 | 135 | A header line will be written to the file only if given as an array of objects. |
135 | 136 |
|
| 137 | + * fieldDelimiter `<string>` (optional) |
| 138 | + |
| 139 | + Default: `,`. Only either comma `,` or semicolon `;` is allowed. |
| 140 | + |
136 | 141 | * encoding `<string>` (optional) |
137 | 142 |
|
138 | 143 | Default: `utf8`. |
@@ -162,6 +167,10 @@ console.log(csvStringifier.stringifyRecords(records)); |
162 | 167 |
|
163 | 168 | Array of field titles |
164 | 169 |
|
| 170 | + * fieldDelimiter `<string>` (optional) |
| 171 | + |
| 172 | + Default: `,`. Only either comma `,` or semicolon `;` is allowed. |
| 173 | + |
165 | 174 | * encoding `<string>` (optional) |
166 | 175 |
|
167 | 176 | Default: `utf8`. |
@@ -201,6 +210,10 @@ console.log(csvStringifier.stringifyRecords(records)); |
201 | 210 |
|
202 | 211 | Array of objects (`id` and `title` properties) or strings (field IDs) |
203 | 212 |
|
| 213 | + * fieldDelimiter `<string>` (optional) |
| 214 | + |
| 215 | + Default: `,`. Only either comma `,` or semicolon `;` is allowed. |
| 216 | + |
204 | 217 | ##### Returns: |
205 | 218 |
|
206 | 219 | * `<ObjectCsvStringifier>` |
@@ -230,6 +243,10 @@ console.log(csvStringifier.stringifyRecords(records)); |
230 | 243 |
|
231 | 244 | Array of field titles |
232 | 245 |
|
| 246 | + * fieldDelimiter `<string>` (optional) |
| 247 | + |
| 248 | + Default: `,`. Only either comma `,` or semicolon `;` is allowed. |
| 249 | + |
233 | 250 | ##### Returns: |
234 | 251 |
|
235 | 252 | * `<ArrayCsvStringifier>` |
|
0 commit comments