Skip to content

adobe/helix-shared

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Apr 29, 2024
Jul 22, 2024
Apr 5, 2023
Oct 3, 2024
Oct 25, 2018
Jan 31, 2023
Sep 17, 2021
May 8, 2019
Jan 28, 2020
Jan 22, 2024
Aug 12, 2019
Apr 27, 2021
Oct 25, 2018
Oct 19, 2019
Feb 28, 2019
Oct 25, 2018
Jan 18, 2024
Jun 6, 2024
Sep 30, 2024
Sep 28, 2024
Jun 6, 2024

Repository files navigation

Helix Shared

Shared libraries for Project Helix.

Status

NPM Version codecov GitHub Actions Workflow Status GitHub license GitHub issues Known Vulnerabilities

Helix Configuration Files

  • helix-fstab.yaml: maps paths to source URLs, use this to pull content from sources other than GitHub
  • helix-config.yaml: defines Strains (variants) of a Helix site, use this to create "environments", tests, or other variants
  • helix-query.yaml: define what can be indexed and queried in a Helix site
  • helix-markup.yaml: define what Markdown should generate which HTML, use this to tweak the HTML output

Usage

Using HelixConfig to read Helix configuration files

Helix is using YAML files for configuration management, but with the HelixConfig class, exported from @adobe/helix-shared, you can read, validate, and access configuration files with ease:

const { HelixConfig } = require('@adobe/helix-shared');

// in an async function
const configfromyaml = new HelixConfig()
  .withSource(yamlstring)
  .init();

const configfromjson = new HelixConfig()
  .withJSON(jsonobject)
  .init();

const configfromfile = new HelixConfig()
  .withDirectory('/path/to/dir') // the directory contains a `helix-config.yaml`
  .init();

Using sequence, functional, and op for functional programming

Development

Build

npm install

Test

npm test

Lint

npm run lint