db.js 364 B

123456789101112131415161718
  1. const Lowdb = require('lowdb')
  2. const FileSync = require('lowdb/adapters/FileSync')
  3. const path = require('path')
  4. const { rcFolder } = require('./rcFolder')
  5. const db = new Lowdb(new FileSync(path.resolve(rcFolder, 'db.json')))
  6. // Seed an empty DB
  7. db.defaults({
  8. projects: [],
  9. foldersFavorite: [],
  10. tasks: [],
  11. config: {}
  12. }).write()
  13. module.exports = {
  14. db
  15. }