Gathering detailed insights and metrics for vfile-statistics
Gathering detailed insights and metrics for vfile-statistics
Gathering detailed insights and metrics for vfile-statistics
Gathering detailed insights and metrics for vfile-statistics
utility to count messages per category: failures, warnings, etc
npm install vfile-statistics
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
88 Commits
4 Forks
6 Watchers
1 Branches
10 Contributors
Updated on May 05, 2024
Latest Version
3.0.0
Package Id
vfile-statistics@3.0.0
Unpacked Size
10.88 kB
Size
4.01 kB
File Count
7
NPM Version
9.6.4
Node Version
20.0.0
Published on
Jun 10, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
vfile utility to count messages per category (fatal, warn, info, etc).
This tiny package gives you stats about messages in files.
This is really tiny, you could do it yourself, but this is useful as a building block.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install vfile-statistics
In Deno with esm.sh
:
1import {statistics} from 'https://esm.sh/vfile-statistics@3'
In browsers with esm.sh
:
1<script type="module"> 2 import {statistics} from 'https://esm.sh/vfile-statistics@3?bundle' 3</script>
1import {VFile} from 'vfile' 2import {statistics} from 'vfile-statistics' 3 4const file = new VFile({path: '~/example.md'}) 5 6file.message('This could be better') 7file.message('That could be better') 8 9try { 10 file.fail('This is terribly wrong') 11} catch {} 12 13file.info('This is perfect') 14 15console.log(statistics(file))
Yields:
1{fatal: 1, nonfatal: 3, warn: 2, info: 1, total: 4}
This package exports the identifier statistics
.
There is no default export.
statistics(file)
Get stats for a file, list of files, or list of messages.
file
(Array<VFile>
, Array<VFileMessage>
,
VFile
, or VFileMessage
)
— file, message, or list of files or messagesStatistics (Statistics
).
Statistics
Statistics (TypeScript type).
fatal
— fatal errors (fatal: true
)warn
— warning messages (fatal: false
)info
— informational messages (fatal: undefined
)nonfatal
— warning or info messagestotal
— all messagesThis package is fully typed with TypeScript.
It exports the additional type Statistics
.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, vfile-statistics@^3
,
compatible with Node.js 16.
See contributing.md
in vfile/.github
for ways to
get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More