forked from xmindltd/xmind-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.easy.js
More file actions
31 lines (21 loc) · 717 Bytes
/
Copy pathexample.easy.js
File metadata and controls
31 lines (21 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
/**
* Example.easy - Easy usage
*/
const { Workbook, Topic, Zipper } = require('xmind');
const wb = new Workbook();
const topic = new Topic({sheet: wb.createSheet('sheet-1', 'central topic')});
const zip = new Zipper({path: '/tmp', workbook: wb});
topic
.on()
.add({title: 'main topic 1'})
.add({title: 'main topic 2'})
.add({title: 'main topic 2.2'})
.add({title: 'main topic 3'})
.on(topic.cid('main topic 1'))
.add({title: 'subtopic 1 on main topic 1'})
.on(topic.cid('main topic 2'))
.add({title: 'subtopic 1 on main topic 2'})
.on(topic.cid('subtopic 1 on main topic 2'))
.add({title: 'test node'});
zip.save().then(status => status && console.log('Saved.'));