Files, they're used as a basic persistence layer by a lot of people, but it often gets fuzzy when they're accessed in multiple different places.
Let's take a simple bank implementation as example, where we have one file getting our balance, and one file is used for transactions (e.g. payments). Our data is stored in a file called bank.json
:
// File: balance.js
// Nice shortcut node! Now I don't need to read my file and parse it manually!
const accounts = require('bank.json');