Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Node.js
  3. js-yaml

js-yaml

MITTypeScript

A fast and complete YAML 1.2 parser and dumper for JavaScript, supporting multiple schemas and CLI usage.

Visit WebsiteGitHubGitHub
6.6k stars823 forks0 contributors

What is js-yaml?

JS-YAML is a JavaScript library that parses and dumps YAML (YAML Ain't Markup Language) data, fully implementing the YAML 1.2 specification. It enables developers to read, write, and manipulate YAML files in Node.js and browser environments, solving the need for a reliable and fast YAML processor in the JavaScript ecosystem.

Target Audience

JavaScript and Node.js developers who work with YAML for configuration files, data serialization, or interoperability with other systems using YAML.

Value Proposition

Developers choose JS-YAML for its high performance, complete YAML 1.2 compliance, and flexibility with multiple schemas and customization options, making it a trusted and efficient alternative to other YAML processors.

Overview

JavaScript YAML parser and dumper. Very fast.

Use Cases

Best For

  • Parsing configuration files in YAML format for Node.js applications
  • Serializing JavaScript objects to YAML for storage or transmission
  • Validating and inspecting YAML documents via CLI
  • Converting between YAML and JSON with customizable schemas
  • Handling multi-document YAML sources in JavaScript
  • Processing YAML data with specific formatting and styling requirements

Not Ideal For

  • Projects using YAML documents with arrays or objects as mapping keys, as JS-YAML stringifies them due to JavaScript limitations.
  • Applications requiring strict JSON schema parsing without YAML-specific extensions, since JS-YAML's JSON schema is more permissive.
  • Teams needing full YAML 1.1 compatibility, as JS-YAML is optimized for YAML 1.2 and may not support older spec features without manual configuration.

Pros & Cons

Pros

Full YAML 1.2 Support

Implements the complete YAML 1.2 specification, including multi-document sources and various schemas, ensuring reliable interoperability with other YAML tools.

High Performance

Optimized from the ground up for speed in both parsing and dumping operations, making it efficient for handling large data sets in Node.js and browsers.

Flexible Schemas

Supports multiple schemas like FAILSAFE, JSON, CORE, and DEFAULT, allowing developers to control type handling based on use cases, such as JSON compatibility or full YAML features.

CLI Tool Included

Includes a global executable for inspecting and validating YAML files from the command line, adding utility beyond library use for debugging and validation tasks.

Extensive Customization

Offers numerous options for output formatting, sorting, quoting, and style handling, giving fine-grained control over how YAML is serialized, as detailed in the dump() options.

Cons

Key Handling Limitations

Cannot properly support YAML documents that use arrays or objects as keys, as JavaScript stringifies them, leading to potential data loss or unexpected behavior, as noted in the caveats section.

Schema Non-Strictness

The JSON schema is not as strictly defined as in the YAML specification, allowing notations like 'Null' for null and numbers in any base, which might cause interoperability issues in strict JSON environments.

Complex Edge Cases

Does not support reading properties on implicit block mapping keys, limiting compatibility with certain YAML constructs and requiring workarounds for advanced use cases.

Frequently Asked Questions

Quick Stats

Stars6,612
Forks823
Contributors0
Open Issues6
Last commit1 day ago
CreatedSince 2011

Tags

#data-serialization#yaml-1.2#yaml-parser#cli-tool#nodejs#javascript-library#configuration-files#data-format

Built With

J
JavaScript
N
Node.js

Links & Resources

Website

Included in

Node.js65.5k
Auto-fetched 19 hours ago

Related Projects

markdown-itmarkdown-it

Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed

Stars21,731
Forks1,839
Last commit1 day ago
remarkremark

markdown processor powered by plugins part of the @unifiedjs collective

Stars8,965
Forks382
Last commit23 days ago
@parcel/css@parcel/css

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.

Stars7,626
Forks286
Last commit4 days ago
URI.jsURI.js

Javascript URL mutation library

Stars6,227
Forks469
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub