# libyaml

> Bindings to libYAML

Latest version **0.2.5** (published 2014-09-08) · 0 weekly downloads

## Install

```sh
npm install libyaml
pnpm add libyaml
yarn add libyaml
bun add libyaml
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2014-09-08 |
| First published | 2011-07-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 13 |
| Author | Stéphan Kochen |
| Maintainers | stephank |

## Links

- npm: https://www.npmjs.com/package/libyaml
- Repository: http://github.com/stephank/yaml.node
- Issues: https://github.com/stephank/yaml.node/issues
- npm.io page: https://npm.io/package/libyaml

## Recent versions

- 0.2.5 (latest) — 2014-09-08
- 0.2.4 — 2014-07-01
- 0.2.3 — 2014-02-04
- 0.2.2 — 2013-03-08
- 0.2.1 — 2012-08-31
- 0.2.0 — 2012-08-17
- 0.1.1 — 2012-04-24
- 0.1.0 — 2012-01-31
- 0.0.4 — 2011-11-03
- 0.0.3 — 2011-10-28
- 0.0.2 — 2011-08-27
- 0.0.1 — 2011-07-18

## README

## YAML.node [![Build Status](https://secure.travis-ci.org/stephank/yaml.node.png)](http://travis-ci.org/stephank/yaml.node)

A simple binding for LibYAML.

### Installing

    $ npm install libyaml

### Usage

    var YAML = require('libyaml');

There's a basic JSON-like API:

    var documents = YAML.parse('Hello world!');
    var data = YAML.stringify({ fancy: ['object', 'structure'] });

And also a `fs`-like API:

    YAML.readFile('myfile.yml', function(error, documents) {
      /* ... */
    });

    var doc1 = { first: 'document' };
    var doc2 = { another: 'doc' };
    YAML.writeFile('myfile.yml', doc1, doc2, function(error) {
      /* ... */
    });

Including synchronous variants:

    var documents = YAML.readFileSync('myfile.yml');
    YAML.writeFileSync('myfile.yml', doc1, doc2);

### Hacking the code

    git clone https://github.com/stephank/yaml.node.git
    cd yaml.node
    npm install
    npm test

### Upgrading from pre-0.1.0

As of 0.1.0, the API immitates the JavaScript built-in `JSON` parser for string handling, and the
Node.js built-in `fs`-module for file I/O. Function names have changed as follows:

    YAML.load ➞ YAML.parse
    YAML.dump ➞ YAML.stringify

    YAML.loadFile ➞ YAML.readFile
    YAML.dumpFile ➞ YAML.writeFile

    YAML.loadFileSync ➞ YAML.readFileSync
    YAML.dumpFileSync ➞ YAML.writeFileSync

    YAML.parse ➞ YAML.stream.parse

---
_Source: https://npm.io/package/libyaml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
