Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options = {}) {
const dbDirectory = path.join(process.cwd(), '.db');
if (!fs.existsSync(dbDirectory)) {
fs.mkdirSync(dbDirectory);
}
const filename = path.join(dbDirectory, 'keyv.db')
this.keyv = new Keyv({
namespace: 'soundworks',
store: new KeyvFile({ filename }),
});
this.keyv.on('error', err => console.log('Connection Error', err));
}
public init(options) {
this.database = new Keyv(options);
}