I have a dir that has a lot of json files. Is there a way that I could load all of them in to ReactJS? Ideally, that would be a dict with filenames as keys and the json as values.
Example: if there are three json files (a.json
, b.json
, and c.json
) under static/json/
directory, what I wanted to do is to have a dict that has the following structure:
{
'a':<parsed json from a.json>,
'b':<parsed json from b.json>,
'c':<parsed json from c.json>
}
That is essentially equivalent to do sth like import a from './static/json/a.json'
3 times and merge to a large json.