Wednesday 19 April 2017

Please help me write a proper JSON file

I would really appreciate any help on this issue I'm having or feedback on this code in general.http://ift.tt/2ooQVBG file that this code writes ends up looking like this [{...},{...},{...}][{...},{...},{...}]...This is invalid JSON. How would I make sure that it's valid like this [{...},{...},{...},{...},{...},{...}]I've tried so many things to make it work including applying a regex to the entire file after the fact, wrapping superagent in a function that returns a promise, and editing the file after the fact in the code that relies on this script to run. All to no avail. I know there must be a better (proper?) way to do this.

Submitted April 20, 2017 at 03:11AM by sha256md5

No comments:

Post a Comment