JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 642061
  • Score
    100M100P100Q194738F
  • License MIT

Count vfile messages per category

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 Build Status Coverage Status

Count vfile messages per category (fatal, nonfatal, and total).

Installation

npm:

npm install vfile-statistics

Usage

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.

License

MIT © Titus Wormer