7
7
[ ![ Backers] [ backers-badge ]] [ collective ]
8
8
[ ![ Chat] [ chat-badge ]] [ chat ]
9
9
10
- Create a report for a ** [ vfile ] [ ] ** .
10
+ [ vfile ] [ ] utility to create a report from a file .
11
11
12
12
![ Example screenshot of vfile-reporter] [ screenshot ]
13
13
14
- ## Features
14
+ ## Contents
15
15
16
- * [x] Ranges (` 3:2 ` and ` 3:2-3:6 ` )
17
- * [x] Stack-traces to show where awful stuff occurs
18
- * [x] Successful files (configurable)
19
- * [x] All of [ ** VFile** ] [ vfile ] ’s awesomeness
16
+ * [ What is this?] ( #what-is-this )
17
+ * [ When should I use this?] ( #when-should-i-use-this )
18
+ * [ Install] ( #install )
19
+ * [ Use] ( #use )
20
+ * [ API] ( #api )
21
+ * [ ` reporter(files[, options]) ` ] ( #reporterfiles-options )
22
+ * [ Types] ( #types )
23
+ * [ Compatibility] ( #compatibility )
24
+ * [ Security] ( #security )
25
+ * [ Related] ( #related )
26
+ * [ Contribute] ( #contribute )
27
+ * [ License] ( #license )
20
28
21
- ## Install
29
+ ## What is this?
30
+
31
+ This package create a textual report from a file showing the warnings that
32
+ occurred while processing.
33
+ Many CLIs of tools that process files, whether linters (such as ESLint) or
34
+ bundlers (such as esbuild), have similar functionality.
35
+
36
+ ## When should I use this?
37
+
38
+ You can use this package whenever you want to display a report about what
39
+ occurred while processing to a human.
22
40
23
- This package is [ ESM only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ) :
24
- Node 12+ is needed to use it and it must be ` import ` ed instead of ` require ` d.
41
+ ## Install
25
42
26
- [ npm] [ ] :
43
+ This package is [ ESM only] [ esm ] .
44
+ In Node.js (version 12.20+, 14.14+, or 16.0+), install with [ npm] [ ] :
27
45
28
46
``` sh
29
47
npm install vfile-reporter
30
48
```
31
49
50
+ In Deno with [ ` esm.sh ` ] [ esmsh ] :
51
+
52
+ ``` js
53
+ import {reporter } from ' https://esm.sh/vfile-reporter@7'
54
+ ```
55
+
56
+ In browsers with [ ` esm.sh ` ] [ esmsh ] :
57
+
58
+ ``` html
59
+ <script type =" module" >
60
+ import {reporter } from ' https://esm.sh/vfile-reporter@7?bundle'
61
+ </script >
62
+ ```
63
+
32
64
## Use
33
65
34
66
Say ` example.js ` contains:
@@ -58,55 +90,72 @@ test/fixture/2.js: no issues found
58
90
59
91
## API
60
92
61
- This package exports the following identifiers: ` reporter ` .
62
- That identifier is also the default export.
93
+ This package exports the identifier ` reporter ` .
94
+ That value is also the default export.
63
95
64
96
### ` reporter(files[, options]) `
65
97
66
- Generate a stylish report from the given [ ` vfile ` ] [ vfile ] , ` Array<VFile> ` ,
67
- or ` Error ` .
98
+ Create a report from an error, on file, or multiple files.
68
99
69
100
##### ` options `
70
101
102
+ Configuration (optional).
103
+
104
+ ###### ` options.color `
105
+
106
+ Use ANSI colors in report (` boolean ` , default: depends).
107
+ The default behavior is the check if [ color is supported] [ supports-color ] .
108
+
71
109
###### ` options.verbose `
72
110
73
- Output long form descriptions of messages, if applicable (` boolean ` , default:
74
- ` false ` ) .
111
+ Show message [ ` note ` ] [ message-note ] s (` boolean ` , default: ` false ` ).
112
+ Notes are optional, additional, long descriptions .
75
113
76
114
###### ` options.quiet `
77
115
78
- Do not output anything for a file which has no warnings or errors (` boolean ` ,
79
- default: ` false ` ).
80
- The default behavior is to show a success message.
116
+ Do not show files without messages (` boolean ` , default: ` false ` ).
81
117
82
118
###### ` options.silent `
83
119
84
- Do not output messages without ` fatal ` set to true (` boolean ` , default:
85
- ` false ` ) .
120
+ Show errors only (` boolean ` , default: ` false ` ).
121
+ This does not show info and warning messages .
86
122
Also sets ` quiet ` to ` true ` .
87
123
88
- ###### ` options.color `
89
-
90
- Whether to use color (` boolean ` , default: depends).
91
- The default behavior is the check if [ color is supported] [ supports-color ] .
92
-
93
124
###### ` options.defaultName `
94
125
95
- Label to use for files without file- path (` string ` , default: ` '<stdin>' ` ).
126
+ Label to use for files without file path (` string ` , default: ` '<stdin>' ` ).
96
127
If one file and no ` defaultName ` is given, no name will show up in the report.
97
128
129
+ ##### Returns
130
+
131
+ ` string ` .
132
+
133
+ ## Types
134
+
135
+ This package is fully typed with [ TypeScript] [ ] .
136
+ It exports the additional type ` Options ` .
137
+
138
+ ## Compatibility
139
+
140
+ Projects maintained by the unified collective are compatible with all maintained
141
+ versions of Node.js.
142
+ As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
143
+ Our projects sometimes work with older versions, but this is not guaranteed.
144
+
145
+ ## Security
146
+
147
+ Use of ` vfile-reporter ` is safe.
148
+
98
149
## Related
99
150
100
151
* [ ` vfile-reporter-json ` ] ( https://github.com/vfile/vfile-reporter-json )
101
- — JSON reporter
152
+ — create a JSON report
102
153
* [ ` vfile-reporter-pretty ` ] ( https://github.com/vfile/vfile-reporter-pretty )
103
- — Pretty reporter
104
- * [ ` convert-vinyl-to-vfile ` ] ( https://github.com/dustinspecker/convert-vinyl-to-vfile )
105
- — Convert from [ Vinyl] [ ]
106
- * [ ` vfile-statistics ` ] ( https://github.com/vfile/vfile-statistics )
107
- — Count messages per category
108
- * [ ` vfile-sort ` ] ( https://github.com/vfile/vfile-sort )
109
- — Sort messages by line/column
154
+ — create a pretty report
155
+ * [ ` vfile-reporter-junit ` ] ( https://github.com/kellyselden/vfile-reporter-junit )
156
+ — create a jUnit report
157
+ * [ ` vfile-reporter-position ` ] ( https://github.com/Hocdoc/vfile-reporter-position )
158
+ — create a report with content excerpts
110
159
111
160
## Contribute
112
161
@@ -115,7 +164,7 @@ get started.
115
164
See [ ` support.md ` ] [ support ] for ways to get help.
116
165
117
166
This project has a [ code of conduct] [ coc ] .
118
- By interacting with this repository, organization , or community you agree to
167
+ By interacting with this repository, organisation , or community you agree to
119
168
abide by its terms.
120
169
121
170
## License
@@ -152,13 +201,19 @@ Nicholas C. Zakas, and licensed under MIT.
152
201
153
202
[ npm ] : https://docs.npmjs.com/cli/install
154
203
155
- [ contributing ] : https://github.com/vfile/.github/blob/HEAD/contributing.md
204
+ [ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
205
+
206
+ [ esmsh ] : https://esm.sh
207
+
208
+ [ typescript ] : https://www.typescriptlang.org
209
+
210
+ [ contributing ] : https://github.com/vfile/.github/blob/main/contributing.md
156
211
157
- [ support ] : https://github.com/vfile/.github/blob/HEAD /support.md
212
+ [ support ] : https://github.com/vfile/.github/blob/main /support.md
158
213
159
214
[ health ] : https://github.com/vfile/.github
160
215
161
- [ coc ] : https://github.com/vfile/.github/blob/HEAD /code-of-conduct.md
216
+ [ coc ] : https://github.com/vfile/.github/blob/main /code-of-conduct.md
162
217
163
218
[ license ] : license
164
219
@@ -172,4 +227,4 @@ Nicholas C. Zakas, and licensed under MIT.
172
227
173
228
[ supports-color ] : https://github.com/chalk/supports-color
174
229
175
- [ vinyl ] : https://github.com/gulpjs/vinyl
230
+ [ message-note ] : https://github.com/vfile/vfile-message#note
0 commit comments