Skip to content

Commit 79bd341

Browse files
committed
feat(stringify): header_as_comment option page
1 parent 0f5bbe0 commit 79bd341

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/md/stringify/options/header.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Run this example with the command `node samples/option.header.js`.
2525

2626
## Using `header` conjointly with `columns`
2727

28-
In case you wish to output the headers on the first line, you can use this option conjointly with the `header` option. The column definition object can receive an optional [`header` property which default to the `key` property](https://github.com/adaltas/node-csv/blob/master/packages/csv-stringify/samples/option.header_with_columns_array_strings.js):
28+
In case you wish to output the headers on the first line, you can use this option conjointly with the `header` option. The column definition object can receive an optional [`header` property which default to the `key` property](https://github.com/adaltas/node-csv/blob/master/packages/csv-stringify/samples/option.header.with_columns_array_strings.js):
2929

30-
`embed:packages/csv-stringify/samples/option.header_with_columns_array_strings.js`
30+
`embed:packages/csv-stringify/samples/option.header.with_columns_array_strings.js`
3131

32-
This example could have been simplified by defining the [column option as an object](https://github.com/adaltas/node-csv/blob/master/packages/csv-stringify/samples/option.header_width_columns_object.js). This approach is not recommended as it implies relying on object property order which JavaScript doesn't guarantee.
32+
This example could have been simplified by defining the [column option as an object](https://github.com/adaltas/node-csv/blob/master/packages/csv-stringify/samples/option.header.with_columns_object.js). This approach is not recommended as it implies relying on object property order which JavaScript doesn't guarantee.
3333

34-
`embed:packages/csv-stringify/samples/option.header_width_columns_object.js`
34+
`embed:packages/csv-stringify/samples/option.header.with_columns_object.js`
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Option header_as_comment
3+
navtitle: header_as_comment
4+
description: Display the column names on the first line if the columns option is provided or discovered
5+
keywords: ['csv', 'stringify', 'options', 'header', 'header_as_comment']
6+
---
7+
8+
# Option `header_as_comment`
9+
10+
The `header_as_comment` option prints the list of columns in the header as a comment.
11+
12+
- Type: `boolean`, `string` or `Buffer`
13+
- Optional
14+
- Default: `false`
15+
- Since: 6.7.0
16+
- Related: [`header`](/stringify/options/header/), [`columns`](/stringify/options/columns/) — see [Available Options](/stringify/options/#available-options)
17+
18+
## Usage
19+
20+
This option implies discovery of columns and the [activation of the `header` columns](https://github.com/adaltas/node-csv/tree/master/packages/csv-stringify/samples/option.header_as_comment.js).
21+
22+
`embed:packages/csv-stringify/samples/option.header_as_comment.js`

0 commit comments

Comments
 (0)