镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
mournerPublic

About

A tiny subset of YAML for JavaScript

Resources

Stars

12 stars

Watchers

1 watching

Forks

Repository files navigation

yeahml

A JavaScript parser for a strict subset of YAML — a minimal amount necessary to be useful for static site generators and simple configuration, while being tiny, safe, unambiguous and without dependencies. Inspired by and largely follows the StrictYAML philosophy.

Node Bundle size Simply Awesome

Usage

Install using NPM (npm install @mourner/yeahml), then import via ESM and call on a YAML source string:

import {parse} from '@mourner/yeahml';

const yamlSource = `
title: My Article
tags:
- opinion
- essay
date: 2026-03-29
version: 3`;

const result = parse(yamlSource);
// {title: 'My Article', tags: ['opinion', 'essay'], date: '2026-03-29', version: '3'}

Key elements

  • Key-value pairs (maps)
  • Lists (sequences), including flat one-line flow sequences (tags: [foo, bar], tags: [])
  • Plain, single-quoted and double-quoted string values (including multi-line, folded like in YAML)
  • Multi-line string literals (| clip, |- strip, |+ keep, > folded clip, >- folded strip, >+ folded keep)
  • Comments

No intention to support

  • Implicit typing (e.g. yes to true, numbers, timestamps)
  • Duplicate keys
  • Flow mappings ({foo: bar, ...}), nested or multi-line flow sequences
  • Anchors and aliases (&ref)
  • Explicit tags (!!int)
  • Complex keys (? foo : bar)
  • Explicit indent indicators (|2, >2)
  • Non-UTF-8 encodings

About

A tiny subset of YAML for JavaScript

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages