npm.io
5.3.0 • Published yesterdayCLI

js-yaml

Licence
MIT
Version
5.3.0
Deps
1
Size
1.5 MB
Vulns
0
Weekly
0
Stars
6.6K
Better alternativeSee documentation for alternatives Documentation

js-yaml

CI NPM version

YAML 1.2 parser and serializer for JavaScript.

Online demo

  • Supports the YAML 1.2 and YAML 1.1 specifications.
  • Passes the entire YAML Test Suite.

If you are upgrading from v4, see the v5 migration guide.

Documentation >>

Install

npm install js-yaml
Usage
import { load } from 'js-yaml'

try {
  const document = load('greeting: hello')
  console.log(document.greeting)
} catch (e) {
  console.error(e)
}
import { dump } from 'js-yaml'

const source = dump({ greeting: 'hello' })
console.log(source)

More usage examples.

Keywords