vfile-reporter-pretty

vfile utility to create a pretty report for a file

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
vfile-reporter-pretty
1807.0.010 months ago8 years agoMinified + gzip package size for vfile-reporter-pretty in KB

Readme

vfile-reporter-pretty
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sizesize-badgesize !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
vfile utility to create a pretty report.
!screenshot

Contents

*   [`reporterPretty(files)`](#reporterprettyfiles)

What is this?

This package is like vfile-reportervfile-reporter but a bit prettier.

When should I use this?

You can use this when you like eslint-formatter-prettyeslint-formatter-pretty, use vfile-reporter itself otherwise.

Install

This package is ESM onlyesm. In Node.js (version 16+), install with npm:
npm install vfile-reporter-pretty

In Deno with esm.shesmsh:
import {reporterPretty} from 'https://esm.sh/vfile-reporter-pretty@7'

In browsers with esm.shesmsh:
<script type="module">
  import {reporterPretty} from 'https://esm.sh/vfile-reporter-pretty@7?bundle'
</script>

Use

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 identifier reporterPrettyapi-reporter-pretty. That identifier is also the default export.

reporterPretty(files)

Create a pretty report from files.
Parameters
— files to report
Returns
Report (string).

Types

This package is fully typed with TypeScript. It exports no additional types.

Compatibility

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-reporter-pretty@^7, compatible with Node.js 16.

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