I'm working on a simple node package, and I want to keep user editable data somewhere.
What I need to store is extremely simple, and a flat file would work too. Here's a representation of example data in JSON:
{
"projects": [
{
"name": "foo",
"dir": "C:/bar"
},
{
"name": "baz",
"dir": "D:/foobaz"
}
]
}
As far as I know, common packages I use (express, meteor, gulp) do not store data in such way, at most they have configuration files.
Using flat-file-db (for example) will make the technical part easy, but I'm wondering what are the accepted norms on how to handle such storage, and how to go about that, i.e, what kind of naming (data.js
in ./lib/
folder or in ./db/
?) and location (user directory or package install location?)