Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80684 views
1
'use strict';
2
3
/*eslint-disable no-console*/
4
5
var fs = require('fs');
6
var path = require('path');
7
var util = require('util');
8
var yaml = require('../lib/js-yaml');
9
10
11
try {
12
var filename = path.join(__dirname, 'sample_document.yml'),
13
contents = fs.readFileSync(filename, 'utf8'),
14
data = yaml.load(contents);
15
16
console.log(util.inspect(data, false, 10, true));
17
} catch (err) {
18
console.log(err.stack || String(err));
19
}
20
21