npm install maketimetable var makeTimeTable = require('maketimetable'),
data;
// first option, generate time table data by specify the number of stages
data = makeTimeTable({
start: new Date('2015-04-18 08:01'),
number: 56
});
// second option, generate time table data by specify the stops
data = makeTimeTable({
start: new Date('2015-04-18 08:01'),
stops: [
'Shanghai',
'Nanjing',
'Beijing',
'Dalian'
]
});
maketimetable -f
maketimetable -c
if your configuration is correct, the json string of generated data will be output to the terminal screen.
{
"start": "2015-04-18 04:04", // specify the departure time for the first stage
"stops": ["A", "B", "C", "D"], // spedify the stops
"number": 56 // specify how many stages you want, if stops propery is also specified, number
// will be ignored
}