libyaml
Bindings to libYAML
Last updated 12 years ago by stephank .
Repository · Original npm · Tarball · package.json
$ npm install libyaml 
SYNC missed versions from official npm registry.

YAML.node Build Status

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

Current Tags

  • 0.2.5                                ...           latest (10 years ago)

12 Versions

  • 0.2.5                                ...           10 years ago
  • 0.2.4                                ...           10 years ago
  • 0.2.3                                ...           11 years ago
  • 0.2.2                                ...           12 years ago
  • 0.2.1                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
  • 0.0.4                                ...           13 years ago
  • 0.0.3                                ...           13 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Total 11
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE