falco-js

v1.0.0-rc2
A lightweight, JSON-only wrapper for falco, a Fastly VCL linter.

Fastly VCL language linter

falco, repackaged for distribution with npm.

JSON output only!

Architecture support

  • darwin-amd64
  • darwin-arm64
  • linux-amd64

Usage

Installation

npm install falco-js

In code

import { lint, lintText } from 'falco-js'

lint('/Absolute/path/to/some.vcl')
  .then((jsonLintResults) => {
    const {
      Infos: suggestionCount,
      Warnings: warningCount,
      Errors: errorCount,
      LintErrors,
      ParseErrors,
      VCL
    } = jsonLintResults
    // ...
  })

lintText('my VCL code')

CLI

falco-js -vv /path/to/file.vcl
falco-js -help

Pipeable (-slurp arg)

cat /path/to/file.vcl | falco-js -slurp
npm i falco-js

Metadata

Downloads