mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
438 B
20 lines
438 B
10 years ago
|
'use strict';
|
||
|
|
||
|
/*eslint-disable no-console*/
|
||
|
|
||
|
var fs = require('fs');
|
||
|
var path = require('path');
|
||
|
var util = require('util');
|
||
|
var yaml = require('../lib/js-yaml');
|
||
|
|
||
|
|
||
|
try {
|
||
|
var filename = path.join(__dirname, 'sample_document.yml'),
|
||
|
contents = fs.readFileSync(filename, 'utf8'),
|
||
|
data = yaml.load(contents);
|
||
|
|
||
|
console.log(util.inspect(data, false, 10, true));
|
||
|
} catch (err) {
|
||
|
console.log(err.stack || String(err));
|
||
|
}
|