format import { exec as opensslWithCallback , Action } from 'openssl-wrapper' ; import { spawn } from 'promisify-child-process' ; export function openssl ( action , options ) { return new Promise ( ( resolve , reject ) => { opensslWithCallback ( action , options , ( err , buffer ) => { if ( err ) { reject ( err ) ; } else if ( buffer ) { resolve ( buffer . toString ( ) ) ; } } ) ; } ) ; } export async function isInstalled ( ) { try { const result = await spawn ( 'openssl' , [ 'version' ] ) ; return result . code === 0 ; } catch ( _e ) { return false ; } }