npm.io
1.5.1 • Published 4 months ago

@stoplight/spectral-formatters

Licence
Apache-2.0
Version
1.5.1
Deps
13
Size
79 kB
Vulns
0
Weekly
0
Stars
3.2K

@stoplight/spectral-formatters

This project exposes the available formatters from the CLI for users that perform custom validation through Javascript.

Usage

import { pretty } from "@stoplight/spectral-formatters";

const spectral = new Spectral();
// ...
const result = await spectral.run(document);

// You can also filter the results here.
const output = pretty(result);

console.error(output);
// ...

Available formatters

Common (available both in the browser and Node.js)
Node.js only
  • pretty
  • github-actions
  • sarif
  • gitlab
  • code-climate