1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const stations = require('db-stations')
const fs = require('fs');
var ds100list = {};
var ds100reverseList = {};
stations.full()
.on('data',function(station){
var stuff = [];
station.ril100Identifiers.forEach(element => {
stuff.push(element.rilIdentifier)
ds100list[element.rilIdentifier] = station.id;
})
if (stuff.length === 0) return;
ds100list[station.id] = stuff.join(', ');
})
.on('end',function(){
fs.writeFile("ds100.json", JSON.stringify(ds100list), () => {})
fs.writeFile("ds100reverse.json", JSON.stringify(ds100reverseList), () => {})a
});