I have a directory of files that a service outputs and each file has no extension. Example file names:
all_events_20170406v1
all_events_20170406v2
Within each file are several unnamed JSON objects such as:
{"event":"event1","id":"123"}
{"event":"event2","id":"456","test":"text","foo":"bar"}
Using node.js I'd like to loop through each file, and then within each object of the file, then capture the key names for deduplication. I can't quite figure out how to read the unnamed objects.
My needed output would be:
event
id
test
foo
Any Suggestions?