New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

yaml-ls-check

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-ls-check

Library and tool used to validate YAML files against one or more schemas utilizing the yaml-language-server project.

latest
Source
npmnpm
Version
1.5.1
Version published
Maintainers
1
Created
Source

yaml-ls-check CI npm version

Provides an easy way to validate YAML files against given schemas utilizing the yaml-language-server project.

This package contains a CLI, a GitHub action, and the library itself.

CLI

Install the CLI via npm:

npm install --global yaml-ls-check

The CLI should now be accessible as yaml-ls-check or the short-hand ylsc, and can be used to validate YAML files:

# Validate all YAML files in the given directory, using the .vscode/settings.json file in it, if present.
ylsc <directory>
ylsc dir <directory>

# Validate given YAML files against the given schema.
# Schema can either be a local or remote one. File paths can be given as glob patterns.
ylsc schema <schema> <files...>

GitHub Action

If you have a .vscode/settings.json in the root of your repository directory, you can just use the action directly:

steps:
- uses: actions/checkout@v2
- uses: InoUno/yaml-ls-check@develop

Additional settings for it are:

  • root: If the repository root should not act as root for the validation.
  • schemaMapping: Specify mapping of schema to file patterns that should match the schema. This overwrites the mapping found in any potential .vscode/settings.json file.
steps:
- uses: actions/checkout@v2
- uses: InoUno/yaml-ls-check@develop
  with:
    root: data
    schemaMapping: |
    {
        "schemas/my-schema.json": [ "files/*.yml" ]
    }

Library

npm install yaml-ls-check
import { validateDirectory } from 'yaml-ls-check';

async function someFunction() {
    const invalidFiles = await validateDirectory('path/to/a/folder');
    // invalidFiles is now an array containing paths to files that failed validation
    // and the found errors in the form: { filePath: string, errors: Diagnostics[] }
}

Keywords

yaml

FAQs

Package last updated on 14 Jun 2025

Did you know?

Socket

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