Skip to content

Commit f512455

Browse files
authored
Fix more typos and grammar in README (#70)
* Fix more typos and grammar in README * Run README.md through prettier
1 parent ffc3e87 commit f512455

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# export-to-csv | Export to CSV Mini Library
22

3-
Small, simple and single purpose. Zero dependencies, functionally inspired and fairly well typed.
3+
Small, simple, and single purpose. Zero dependencies, functionally inspired, and fairly well-typed.
44

5-
If you're looking for a fully CSV compliant, consistently maintained, whole-package library, I'd recommend looking elsewhere! (see [alternatives](#alternatives) section below)
5+
If you're looking for a fully CSV-compliant, consistently maintained, whole-package library, I'd recommend looking elsewhere! (see [alternatives](#alternatives) section below)
66

77
If you want a lightweight, stable, easy-to-use basic CSV generation and download library, feel free to install.
88

@@ -96,21 +96,21 @@ writeFile(filename, csvBuffer, (err) => {
9696

9797
## API
9898

99-
| Option | Default | Type | Description |
100-
| ------------------- | -------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101-
| `fieldSeparator` | `","` | `string` | Defines the field separator character |
102-
| `filename` | `"generated"` | `string` | Sets the name of the file creates from the `download` function |
103-
| `quoteStrings` | `false` | `boolean` | Determines whether or not to quote strings (using `quoteCharacter`'s value). Whether or not this is set, `\r`, `\n`, and `fieldSeparator` will be quoted. |
104-
| `quoteCharacter` | `'"'` | `string` | Sets the quote character to use. |
105-
| `decimalSeparator` | `"."` | `string` | Defines the decimal separator character (default is .). If set to "locale", it uses the [language sensitive representation of the number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString). |
106-
| `showTitle` | `false` | `boolean` | Sets whether or not to add the value of `title` to the start of the CSV. (This is not supported by all CSV readers) |
107-
| `title` | `"My Generated Report"` | `string` | The title to display as the first line of the CSV file. (This **is not** the name of the file [see `filename`]) |
108-
| `showColumnHeaders` | `true` | `boolean` | Determines if columns should have headers. When set to `false`, the first row of the CSV will be data. |
109-
| `columnHeaders` | `[]` | `Array<string \| {key: string, displayLabel: string}>` | **Use this option if column/header order is important!** Determines the headers to use as the first line of the CSV data. If the item is a `string`, it will be used for lookup in your collection AND as the header label. If the item is an object, `key` will be used for lookup and `displayLabel` will be used as the header label. |
110-
| `useKeysAsHeaders` | `false` | `boolean` | If set, the CSV will use the key names in your collection as headers. **Warning: `headers` recommended for large collections. If set, it'll override the `headers` option. Column/header order also not guaranteed. Use `headers` only if order is important!** |
111-
| `boolDisplay` | `{true: "TRUE", false: "FALSE"}` | `{true: string, false: string}` | Determines how to display boolean values in the CSV. **This only works for `true` and `false`. `1` and `0` will not be coerced and will display as `1` and `0`.** |
112-
| `useBom` | `true` | `boolean` | Adds a [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) which is required by Excel to display CSVs, despite is not being necessary with UTF-8 🤷‍♂️ |
113-
| `useTextFile` | `false` | `boolean` | Will download the file as `text/plain` instead of `text/csv` and use a `.txt` vs `.csv` file-extension. |
99+
| Option | Default | Type | Description |
100+
| ------------------- | -------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101+
| `fieldSeparator` | `","` | `string` | Defines the field separator character |
102+
| `filename` | `"generated"` | `string` | Sets the name of the file created from the `download` function |
103+
| `quoteStrings` | `false` | `boolean` | Determines whether or not to quote strings (using `quoteCharacter`'s value). Whether or not this is set, `\r`, `\n`, and `fieldSeparator` will be quoted. |
104+
| `quoteCharacter` | `'"'` | `string` | Sets the quote character to use. |
105+
| `decimalSeparator` | `"."` | `string` | Defines the decimal separator character (default is .). If set to "locale", it uses the [language-sensitive representation of the number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString). |
106+
| `showTitle` | `false` | `boolean` | Sets whether or not to add the value of `title` to the start of the CSV. (This is not supported by all CSV readers) |
107+
| `title` | `"My Generated Report"` | `string` | The title to display as the first line of the CSV file. (This **is not** the name of the file [see `filename`]) |
108+
| `showColumnHeaders` | `true` | `boolean` | Determines if columns should have headers. When set to `false`, the first row of the CSV will be data. |
109+
| `columnHeaders` | `[]` | `Array<string \| {key: string, displayLabel: string}>` | **Use this option if column/header order is important!** Determines the headers to use as the first line of the CSV data. If the item is a `string`, it will be used for lookup in your collection AND as the header label. If the item is an object, `key` will be used for lookup, and `displayLabel` will be used as the header label. |
110+
| `useKeysAsHeaders` | `false` | `boolean` | If set, the CSV will use the key names in your collection as headers. **Warning: `headers` recommended for large collections. If set, it'll override the `headers` option. Column/header order also not guaranteed. Use `headers` only if order is important!** |
111+
| `boolDisplay` | `{true: "TRUE", false: "FALSE"}` | `{true: string, false: string}` | Determines how to display boolean values in the CSV. **This only works for `true` and `false`. `1` and `0` will not be coerced and will display as `1` and `0`.** |
112+
| `useBom` | `true` | `boolean` | Adds a [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) which is required by Excel to display CSVs, despite it not being necessary with UTF-8 🤷‍♂️ |
113+
| `useTextFile` | `false` | `boolean` | Will download the file as `text/plain` instead of `text/csv` and use a `.txt` vs `.csv` file extension. |
114114

115115
# Alternatives
116116

@@ -121,7 +121,7 @@ As mentioned above, this library is intentionally small and was designed to solv
121121

122122
# Thanks!
123123

124-
This library was originally based off of [this library](https://github.com/javiertelioz/angular2-csv) by Javier Telio
124+
This library was originally based on [this library](https://github.com/javiertelioz/angular2-csv) by Javier Telio
125125

126126
| Credits and Original Authors |
127127
| :-------------------------------------------------- |

0 commit comments

Comments
 (0)