How to use the envfile.stringify function in envfile

To help you get started, we’ve selected a few envfile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tellform / tellform / scripts / setup.js View on Github external
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']

envfile

Parse and stringify the environment configuration files and format, also known as .env files and dotenv files

Artistic-2.0
Latest version published 9 months ago

Package Health Score

68 / 100
Full package analysis