Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function start(port) {
for (var prop in low.db) {
console.log('http://localhost:' + port + '/' + chalk.green(prop))
}
console.log(
'\nEnter ' + chalk.green('`s`') + ' at any time to create a snapshot of the db\n'
)
process.stdin.resume()
process.stdin.setEncoding('utf8')
process.stdin.on('data', function (chunk) {
if (chunk.trim().toLowerCase() === 's') {
var file = 'db-' + Date.now() + '.json'
low.save(file)
console.log('\nSaved snapshot to ' + chalk.green(file) + '\n')
}
})