Package Exports
- vfile-statistics
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vfile-statistics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vfile-statistics

Count vfile messages per category (fatal, nonfatal, and total).
Installation
npm:
npm install vfile-statisticsUsage
var statistics = require('vfile-statistics');
var vfile = require('vfile');
var file = vfile({path: '~/example.md'});
file.message('This could be better');
file.message('That could be better');
try {
file.fail('This is terribly wrong');
} catch (err) {}
console.log(statistics(file));Yields:
{ fatal: 1, nonfatal: 2, total: 3 }API
statistics(file)
Pass a vfile, list of vfiles, or a list of messages
(file.messages), get counts per category.