This package provides a simple interface to the certreq command.
foo@bar: npm install node-certreq --save
const certreq = require("node-certreq");
certreq.run(["-submit", "-attrib", "CertificateTemplate XXX"], function (data) {
// the data object will contain every process output
console.log(data);
});
The Library will call this function with all return values of the process:
Important: "processError" is not directly a sign of an error, consider hasError as the primary detection. Check this Article for more information about how openssl for example handles
stderr
. In addition, certreq spawns windows - if the user closes the window without finishing it will result in a process error.
[
(processError: ""),
(processOutput: "certreq output"),
(processExitCode: 0), // <- That's the important one!
(processEnd: "closed"), // <- Shows how the process exited
(hasError: false),
];
That's all that you need to start using it.
For any information, improvements or bug fixes please contact me.