How to use the pem.version function in pem

To help you get started, we’ve selected a few pem 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 beameio / beame-insta-ssl / cli / beame.js View on Github external
function main() {
	let cmdName, subCmdName, cmd;

	if (pem.version) {
		pem.config({sync: true});
		pem.version((err, data) => {
			if (err) {
				throw Error("Could not run openssl. beame-insta-ssl requires openssl. Please make sure openssl is installed and is in PATH");
			}
		});
		pem.config({sync: false});
	} else {
		if (!process.env.BEAME_NO_PEM_WARNING) {
			logger.info("WARNING: Using 'pem' module without 'config' function. Not checking for openssl availability.");
		}
	}

	// getHelpMessage() is only defined in this file.
	commands.creds.getCreds.toText = (metadata) => `Certificate created! Certificate FQDN is ${metadata.fqdn}\n\n` + getHelpMessage('certificate-created.txt');

	// Old CLI compatibility - start
	let do_warn = false, orig_command = argv._[0];