Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
inquirer.prompt(questions.slice(1)).then(function (answers) {
answers['NODE_ENV'] = 'production';
var email = answers['email'];
var username = answers['username'];
var pass = answers['password'];
delete answers['email'];
delete answers['password'];
envfile.stringify(answers, function (err, str) {
try {
fs.outputFileSync('./\.env', str);
} catch (fileErr) {
return console.error(chalk.red(fileErr));
}
console.log(chalk.green('Successfully created .env file'));
user = new User({
firstName: 'Admin',
lastName: 'Account',
email: email,
username: username,
password: pass,
provider: 'local',
roles: ['admin', 'user']