NodeJS : generating json files for live result