doramatadora / falco-js

A lightweight and opinionated wrapper for falco, a Fastly VCL linter, repackaged for npm distribution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A lightweight and opinionated wrapper for falco, a Fastly VCL linter, repackaged for npm distribution.

License:MIT License


Languages

Language:JavaScript 88.4%Language:Makefile 11.6%