Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function load(source, port) {
console.log(chalk.green('\n{^ ^} Heya!\n'))
console.log('Loading database from ' + source + '\n')
if (/\.json$/.test(source)) {
var path = process.cwd() + '/' + source
low.path = path
low.db = require(path);
start(port)
}
if (/\.js$/.test(source)) {
var path = process.cwd() + '/' + source
low.db = require(path).run();
start(port)
}
if (/^http/.test(source)) {
request
.get(source)
.end(function(err, res) {
if (err) {
console.error(err)