Me llamo Jorge Aznar y trabajo como front{data} en Shokesu.
mociones = JSON.parse(fs.readFileSync('mociones/mociones.json','utf8'));
$presentada = _.countBy(mociones, function(res) {
return (res.presentada)
})
fs.writeFile('estadisticas/presentada.json', JSON.stringify($presentada, null, 2), function(err)
{
if (err) {
throw err;
}
});
{
"C'S": 103,
"ZEC": 73,
"PP": 119,
"PSOE": 139,
"CHA": 100,
"PP + PSOE + C'S": 3
}