Socket
Socket
Sign inDemoInstall

vfile-reporter

Package Overview
Dependencies
17
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vfile-reporter

Stylish reporter for virtual files


Version published
Maintainers
1
Install size
114 kB
Created

Readme

Source

vfile-reporter Build Status Coverage Status

Format VFiles using a stylish reporter.

Originally forked from ESLint’s stylish reporter, but with some coolness added.

Example screen shot of vfile-reporter

Features

  • Ranges — Not just a starting position, such as 3:2, but 3:2-3:6.

  • Stack-traces — When something awful happens, you want to know where it occurred, stack-traces help answer that question.

  • Successful files (configurable) — Sometimes you want to know if things went okay.

  • And all of VFiles awesomeness.

Installation

npm:

npm install vfile-report

Usage

var toVFile = require('to-vfile');
var reporter = require('vfile-reporter');

var one = toVFile('test/fixture/1.js');
var two = toVFile('test/fixture/2.js');

/*
 * See VFile’s docs for more info on how to warn.
 */

one.warn('Warning!', {
    'line': 2,
    'column': 4
});

console.log(reporter([one, two]));

Yields:

test/fixture/1.js
        2:4  warning  Warning!

test/fixture/2.js: no issues found

⚠ 1 warning

API

reporter(vfiles[, options])

Generate a stylish report from the given files.

Signatures

  • report = reporter(file[, options])
  • report = reporter(files[, options])

Parameters

  • options (Object, optional)

    • quiet (boolean, default: false) — Do not output anything for a file which has no warnings or errors. The default behaviour is to show a success message.

    • silent (boolean, default: false) — Do not output messages without fatal set to true. Also sets quiet to true.

Returns: string, a stylish report.

License

MIT © Titus Wormer

Forked from ESLint’s stylish reporter (originally created by Sindre Sorhus), which is Copyright (c) 2013 Nicholas C. Zakas, and licensed under MIT.

Keywords

FAQs

Last updated on 21 Nov 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc