CSV to JSON function in NodeJS