19
19
* [ Use] ( #use )
20
20
* [ API] ( #api )
21
21
* [ ` reporter(files[, options]) ` ] ( #reporterfiles-options )
22
+ * [ ` Options ` ] ( #options )
22
23
* [ Types] ( #types )
23
24
* [ Compatibility] ( #compatibility )
24
25
* [ Security] ( #security )
@@ -44,7 +45,7 @@ listed in vfile.
44
45
## Install
45
46
46
47
This package is [ ESM only] [ esm ] .
47
- In Node.js (version 12.20+, 14.14+, or 16.0+), install with [ npm] [ ] :
48
+ In Node.js (version 14.14+ and 16.0+), install with [ npm] [ ] :
48
49
49
50
``` sh
50
51
npm install vfile-reporter
@@ -93,57 +94,55 @@ test/fixture/2.js: no issues found
93
94
94
95
## API
95
96
96
- This package exports the identifier ` reporter ` .
97
- That value is also the default export.
97
+ This package exports the identifier [ ` reporter ` ] [ api-reporter ] .
98
+ That value is also the ` default ` export.
98
99
99
100
### ` reporter(files[, options]) `
100
101
101
102
Create a report from an error, one file, or multiple files.
102
103
103
- ##### ` options `
104
+ ###### Parameters
104
105
105
- Configuration (optional).
106
+ * ` files ` ([ ` VFile ` ] [ vfile ] , ` Array<VFile> ` , or ` Error ` )
107
+ — files or error to report
108
+ * ` options ` ([ ` Options ` ] [ api-options ] , optional)
109
+ — configuration
106
110
107
- ###### ` options.color `
111
+ ###### Returns
108
112
109
- Use ANSI colors in report (` boolean ` , default: depends).
110
- The default behavior in Node.js is the check if [ color is
111
- supported] [ supports-color ] .
112
-
113
- ###### ` options.verbose `
114
-
115
- Show message [ ` note ` ] [ message-note ] s (` boolean ` , default: ` false ` ).
116
- Notes are optional, additional, long descriptions.
117
-
118
- ###### ` options.quiet `
119
-
120
- Do not show files without messages (` boolean ` , default: ` false ` ).
121
-
122
- ###### ` options.silent `
123
-
124
- Show errors only (` boolean ` , default: ` false ` ).
125
- This does not show info and warning messages.
126
- Also sets ` quiet ` to ` true ` .
113
+ Report (` string ` ).
127
114
128
- ###### ` options.defaultName `
115
+ ### ` Options `
129
116
130
- Label to use for files without file path (` string ` , default: ` '<stdin>' ` ).
131
- If one file and no ` defaultName ` is given, no name will show up in the report.
117
+ Configuration (TypeScript type).
132
118
133
- ##### Returns
119
+ ###### Fields
134
120
135
- Report (` string ` ).
121
+ * ` color ` (` boolean ` , default: depends)
122
+ — use ANSI colors in report, the default behavior in Node.js is the check
123
+ if [ color is supported] [ supports-color ]
124
+ * ` verbose ` (` boolean ` , default: ` false ` )
125
+ — show message [ ` note ` ] [ message-note ] s, notes are optional, additional,
126
+ long descriptions
127
+ * ` quiet ` (` boolean ` , default: ` false ` )
128
+ — do not show files without messages
129
+ * ` silent ` (` boolean ` , default: ` false ` )
130
+ — show errors only, this hides info and warning messages, and sets
131
+ ` quiet: true `
132
+ * ` defaultName ` (` string ` , default: ` '<stdin>' ` ).
133
+ — label to use for files without file path, if one file and no
134
+ ` defaultName ` is given, no name will show up in the report
136
135
137
136
## Types
138
137
139
138
This package is fully typed with [ TypeScript] [ ] .
140
- It exports the additional type ` Options ` .
139
+ It exports the additional type [ ` Options ` ] [ api-options ] .
141
140
142
141
## Compatibility
143
142
144
143
Projects maintained by the unified collective are compatible with all maintained
145
144
versions of Node.js.
146
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
145
+ As of now, that is Node.js 14.14+ and 16 .0+.
147
146
Our projects sometimes work with older versions, but this is not guaranteed.
148
147
149
148
## Security
@@ -234,3 +233,7 @@ Nicholas C. Zakas, and licensed under MIT.
234
233
[ message-note ] : https://github.com/vfile/vfile-message#note
235
234
236
235
[ screenshot ] : screenshot.png
236
+
237
+ [ api-reporter ] : #reporterfiles-options
238
+
239
+ [ api-options ] : #options
0 commit comments