-
Notifications
You must be signed in to change notification settings - Fork 0
/
preset.js
45 lines (32 loc) · 896 Bytes
/
preset.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var fs = require('fs');
var mustache = require('mustache');
function createStartPassage(routeName) {
var str = ":: Start\n\n";
var file = fs.readFileSync('./preset/start.txt');
str += mustache.render(file.toString(), {
dest: routeName
});
return str;
}
function createEndPassage(number) {
var str = ":: end\n\n";
var file = fs.readFileSync('./preset/end.txt');
str += mustache.render(file.toString(), {
number: number
});
return str;
}
function createLostPassage(destination, number) {
var str = ":: lost-" + number + "\n\n";
var file = fs.readFileSync('./preset/lost.txt');
str += mustache.render(file.toString(), {
home: "home-" + number,
destination: destination
});
return str;
}
module.exports = {
start: createStartPassage,
end: createEndPassage,
lost: createLostPassage
};