I am having a difficult time trying to figure out where to place a certain file in my javascript project.
I have a fairly large JSON object that represents ISO language codes:
{"code":"nl","name":"Dutch","nativeName":"Nederlands, Vlaams"},
{"code":"en","name":"English","nativeName":"English"},
{"code":"eo","name":"Esperanto","nativeName":"Esperanto"},
{"code":"et","name":"Estonian","nativeName":"eesti, eesti keel"},
{"code":"ee","name":"Ewe","nativeName":"Eʋegbe"},
I did not want to retrieve this information from an API as this info is fairly static and does not change often.
I am just 'importing' this ISO language code Object file in the JS file that needs to reference it.
However, I have no idea where to actually place this file.
My current project file structure:
root/
package.json
webpack.config.js
node_modules/
dist/
src/
index.html
js/
models/
views/
config.js
index.js -- (single application controller)
iso-language-codes.js
As you can see, 'iso-language-codes.js' resides at the same level as the application controller 'index.js.'
I know this is pretty weak, but where should I put it? Mostly, this kind of thing is preference, but logic tells me I should create a new 'data' folder and put the 'iso-language-codes.js' within the new directory like below:
src/
index.html
js/
models/
views/
config.js
index.js -- (single application controller)
data/
iso-language-codes.js
Any recommendations are greatly appreciated.
Spent a good deal of time googling and searching stack, but could not find anything to answer my specific question. If anyone has anything I can reference, that would be great.