All Projects → eemeli → Yaml

eemeli / Yaml

Licence: isc
JavaScript parser and stringifier for YAML

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Yaml

Json Schema Validator
A fast Java JSON schema validator that supports draft V4, V6, V7 and V2019-09
Stars: ✭ 292 (-20%)
Mutual labels:  yaml
Grabana
User-friendly Go library for building Grafana dashboards
Stars: ✭ 313 (-14.25%)
Mutual labels:  yaml
Pico
Pico is a stupidly simple, blazing fast, flat file CMS.
Stars: ✭ 3,494 (+857.26%)
Mutual labels:  yaml
Tmuxp
💻 tmux session manager. built on libtmux
Stars: ✭ 3,269 (+795.62%)
Mutual labels:  yaml
Yaml
The Yaml component loads and dumps YAML files.
Stars: ✭ 3,359 (+820.27%)
Mutual labels:  yaml
Kubernetes Yaml Templates
Kubernetes Yaml Templates
Stars: ✭ 313 (-14.25%)
Mutual labels:  yaml
Dyff
/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
Stars: ✭ 277 (-24.11%)
Mutual labels:  yaml
Grow
A declarative website generator designed for high-quality websites, with a focus on easy maintenance and localization.
Stars: ✭ 360 (-1.37%)
Mutual labels:  yaml
Esphome
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Stars: ✭ 4,324 (+1084.66%)
Mutual labels:  yaml
Awsweeper
A tool for cleaning your AWS account
Stars: ✭ 331 (-9.32%)
Mutual labels:  yaml
Yamale
A schema and validator for YAML.
Stars: ✭ 302 (-17.26%)
Mutual labels:  yaml
Yacron
A modern Cron replacement that is Docker-friendly
Stars: ✭ 302 (-17.26%)
Mutual labels:  yaml
Hoplite
A boilerplate-free library for loading configuration files as data classes in Kotlin
Stars: ✭ 322 (-11.78%)
Mutual labels:  yaml
Envfile
EnvFile 3.0 is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
Stars: ✭ 293 (-19.73%)
Mutual labels:  yaml
Yq
yq is a portable command-line YAML processor
Stars: ✭ 4,726 (+1194.79%)
Mutual labels:  yaml
Confuse
painless YAML config files for Python
Stars: ✭ 285 (-21.92%)
Mutual labels:  yaml
Rustbreak
A simple, fast and easy to use self-contained single file storage for Rust
Stars: ✭ 315 (-13.7%)
Mutual labels:  yaml
Serde Yaml
Strongly typed YAML library for Rust
Stars: ✭ 364 (-0.27%)
Mutual labels:  yaml
Macos security
macOS Security Compliance Project
Stars: ✭ 348 (-4.66%)
Mutual labels:  yaml
Jk
Configuration as Code with ECMAScript
Stars: ✭ 322 (-11.78%)
Mutual labels:  yaml

YAML

yaml is a definitive library for YAML, the human friendly data serialization standard. This library:

  • Supports both YAML 1.1 and YAML 1.2 and all common data schemas,
  • Passes all of the yaml-test-suite tests,
  • Can accept any string as input without throwing, parsing as much YAML out of it as it can, and
  • Supports parsing, modifying, and writing YAML comments and blank lines.

The library is released under the ISC open source license, and the code is available on GitHub. It has no external dependencies and runs on Node.js as well as modern browsers.

For the purposes of versioning, any changes that break any of the documented endpoints or APIs will be considered semver-major breaking changes. Undocumented library internals may change between minor versions, and previous APIs may be deprecated (but not removed).

For more information, see the project's documentation site: eemeli.org/yaml

To install:

npm install [email protected]

Note: These docs are for [email protected]. For v1, see the v1.10.0 tag for the source and eemeli.org/yaml/v1 for the documentation.

API Overview

The API provided by yaml has three layers, depending on how deep you need to go: Parse & Stringify, Documents, and the underlying Lexer/Parser/Composer. The first has the simplest API and "just works", the second gets you all the bells and whistles supported by the library along with a decent AST, and the third lets you get progressively closer to YAML source, if that's your thing.

import { parse, stringify } from 'yaml'
// or
import YAML from 'yaml'
// or
const YAML = require('yaml')

Parse & Stringify

Documents

Content Nodes

Parsing YAML

YAML.parse

# file.yml
YAML:
  - A human-readable data serialization language
  - https://en.wikipedia.org/wiki/YAML
yaml:
  - A complete JavaScript implementation
  - https://www.npmjs.com/package/yaml
import fs from 'fs'
import YAML from 'yaml'

YAML.parse('3.14159')
// 3.14159

YAML.parse('[ true, false, maybe, null ]\n')
// [ true, false, 'maybe', null ]

const file = fs.readFileSync('./file.yml', 'utf8')
YAML.parse(file)
// { YAML:
//   [ 'A human-readable data serialization language',
//     'https://en.wikipedia.org/wiki/YAML' ],
//   yaml:
//   [ 'A complete JavaScript implementation',
//     'https://www.npmjs.com/package/yaml' ] }

YAML.stringify

import YAML from 'yaml'

YAML.stringify(3.14159)
// '3.14159\n'

YAML.stringify([true, false, 'maybe', null])
// `- true
// - false
// - maybe
// - null
// `

YAML.stringify({ number: 3, plain: 'string', block: 'two\nlines\n' })
// `number: 3
// plain: string
// block: |
//   two
//   lines
// `

Browser testing provided by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].