1 | const low = require('lowdb')
|
2 | const FileSync = require('lowdb/adapters/FileSync')
|
3 | const path = require('path')
|
4 | const home = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME']
|
5 |
|
6 | const adapter = new FileSync(path.join(home, 'gmail.json'))
|
7 | const db = low(adapter)
|
8 |
|
9 | db.defaults({ prefs: {}, credentials: {}, pages: {}, messages: [] })
|
10 | .write()
|
11 |
|
12 | module.exports = (function () {
|
13 | return db
|
14 | })()
|