Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A schema allowing js-yaml to process YAML documents including Home Assistent specific local tags.

License

Notifications You must be signed in to change notification settings

pascalre/homeassistant-js-yaml-schema

Repository files navigation

homeassistant-js-yaml-schema

Coverage Status

Schema to allow js-yaml to process YAML formatted Home Assistent templates that use Home Assistent specific local tags while parsing or dumping, for example: !env_var, !include_dir_named.

See tags.json for currently supported local tags.

Usage

const jsyaml = require('js-yaml');
const fs = require('fs');
import { HOMEASSISTANT_SCHEMA } from "homeassistant-js-yaml-schema"
let doc = yaml.load(fs.readFileSync('/path/to/file.yml', 'utf8'));
let body = jsyaml.load(doc, { schema: HOMEASSISTANT_SCHEMA });
console.log(JSON.stringify(body, null, 2));
body = jsyaml.dump(body, { schema: HOMEASSISTANT_SCHEMA });
console.log(body);

See usage in vscode-yaml-sort.

License

homeassistant-js-yaml-schema is licensed under the MIT License.

About

A schema allowing js-yaml to process YAML documents including Home Assistent specific local tags.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

AltStyle によって変換されたページ (->オリジナル) /