oeffisearch/ds100.js

23 lines
583 B
JavaScript
Raw Normal View History

2020-02-07 14:09:42 +01:00
const stations = require('db-stations')
const fs = require('fs');
2020-06-12 16:49:54 +02:00
var ds100list = {};
var ds100reverseList = {};
2020-02-07 14:09:42 +01:00
stations.full()
.on('data',function(station){
var stuff = [];
station.ril100Identifiers.forEach(element => {
stuff.push(element.rilIdentifier)
2020-06-12 16:49:54 +02:00
ds100reverseList[element.rilIdentifier] = station.id;
2020-02-07 14:09:42 +01:00
})
if (stuff.length === 0) return;
ds100list[station.id] = stuff.join(', ');
})
.on('end',function(){
2020-06-12 16:49:54 +02:00
fs.writeFile("ds100.json", JSON.stringify(ds100list), () => {});
fs.writeFile("ds100reverse.json", JSON.stringify(ds100reverseList), () => {});
2020-02-07 14:09:42 +01:00
});