vfile-reporter-pretty

vfile utility to create a pretty report for a file

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
vfile-reporter-pretty
1706.1.02 years ago6 years agoMinified + gzip package size for vfile-reporter-pretty in KB

Readme

vfile-reporter-pretty
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
Create a pretty report for a vfile.
!
screenshot

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.
npm install vfile-reporter-pretty
## Use

```js
import {VFile} from 'vfile'
import {reporterPretty} from 'vfile-reporter-pretty'

const file = new VFile({path: '~/example.md'})

file.message('`braavo` is misspelt; did you mean `bravo`?', {line: 1, column: 8})
file.info('This is perfect', {line: 2, column: 1})

try {
  file.fail('This is horrible', {line: 3, column: 5})
} catch (error) {}

console.log(reporterPretty([file]))

API

This package exports the following identifiers: reporterPretty. That identifier is also the default export.

reporterPretty(files)

Create a report (string) for the given files.
files
List of files (Array.<VFile>vfile).

Contribute

See contributing.mdcontributing in vfile/.githubhealth for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Sindre Sorhusauthor