Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#! /usr/bin/env node
'use strict'
const path = require('path')
let Connection
let config
try {
Connection = require('@dadi/api').Connection
config = require('@dadi/api').Config
} catch (err) {
Connection = require(path.join(__dirname, '/../dadi/lib/model/connection'))
config = require(path.join(__dirname, '/../config'))
}
const clientCollectionName = config.get('auth.clientCollection')
const dbOptions = { override: true, database: config.get('auth.database'), collection: clientCollectionName }
const connection = Connection(dbOptions, config.get('auth.datastore'))
const prompt = require('cli-prompt')
let connected = false
// Temporarily restore original console
delete console.log