Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80684 views
1
'use strict';
2
3
/*eslint-disable no-console*/
4
5
var yaml = require('../lib/js-yaml');
6
var object = require('./dumper.json');
7
8
9
console.log(yaml.dump(object, {
10
flowLevel: 3,
11
styles: {
12
'!!int' : 'hexadecimal',
13
'!!null' : 'camelcase'
14
}
15
}));
16
17
18
// Output:
19
//==============================================================================
20
// name: Wizzard
21
// level: 0x11
22
// sanity: Null
23
// inventory:
24
// - name: Hat
25
// features: [magic, pointed]
26
// traits: {}
27
// - name: Staff
28
// features: []
29
// traits: {damage: 0xA}
30
// - name: Cloak
31
// features: [old]
32
// traits: {defence: 0x0, comfort: 0x3}
33
34