vfile-statistics

WebJar for vfile-statistics

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

vfile-statistics
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

vfile-statistics
WebJar for vfile-statistics
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/vfile/vfile-statistics

Download vfile-statistics

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/vfile-statistics/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>vfile-statistics</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/vfile-statistics/
implementation 'org.webjars.npm:vfile-statistics:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/vfile-statistics/
implementation ("org.webjars.npm:vfile-statistics:1.1.3")
'org.webjars.npm:vfile-statistics:jar:1.1.3'
<dependency org="org.webjars.npm" name="vfile-statistics" rev="1.1.3">
  <artifact name="vfile-statistics" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='vfile-statistics', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "vfile-statistics" % "1.1.3"
[org.webjars.npm/vfile-statistics "1.1.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

vfile-statistics

Build Coverage Downloads Size Sponsors Backers Chat

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

Install

npm:

npm install vfile-statistics

Use

var vfile = require('vfile')
var statistics = require('vfile-statistics')

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) {}

file.info('This is perfect')

console.log(statistics(file))

Yields:

{fatal: 1, nonfatal: 3, warn: 2, info: 1, total: 4}

API

statistics(file)

Pass a vfile, list of vfiles, or a list of messages (file.messages), get counts per category.

Returns

Object:

  • fatal: fatal errors (fatal: true)
  • warn: warning messages (fatal: false)
  • info: informational messages (fatal: null or fatal: undefined)
  • nonfatal: warning or info messages
  • total: all messages

Contribute

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.

License

MIT © Titus Wormer

org.webjars.npm
Virtual file format for text processing used in @unifiedjs

Versions

Version
1.1.3