index.js
function(ethereumAddress, ethereumDataDir, ethereumAccountPassword, cb = null){
        if(isFunction(cb)){
            try {
                keythereum.importFromFile(ethereumAddress, ethereumDataDir, function(keyObject){
                    keythereum.recover(ethereumAccountPassword, keyObject, function(privateKey){
                        return cb(null, privateKey)
                    })
                })
            } catch (err){
                return cb(err)
            }
        } else {
            try {
                var keyObject = keythereum.importFromFile(ethereumAddress, ethereumDataDir)
                return keythereum.recover(ethereumAccountPassword, keyObject)
            } catch (err){
                return err
            }
        }
    }
function(ethereumAddress, ethereumDataDir, ethereumAccountPassword, cb = null){
        if(isFunction(cb)){
            try {
                keythereum.importFromFile(ethereumAddress, ethereumDataDir, function(keyObject){
                    keythereum.recover(ethereumAccountPassword, keyObject, function(privateKey){
                        return cb(null, privateKey)
                    })
                })
            } catch (err){
                return cb(err)
            }
        } else {
            try {
                var keyObject = keythereum.importFromFile(ethereumAddress, ethereumDataDir)
                return keythereum.recover(ethereumAccountPassword, keyObject)
            } catch (err){
                return err
            }
        }
    }
function ( ethereumAddress , ethereumDataDir , ethereumAccountPassword , cb = null ) { if ( isFunction ( cb ) ) { try { keythereum . importFromFile ( ethereumAddress , ethereumDataDir , function ( keyObject ) { keythereum . recover ( ethereumAccountPassword , keyObject , function ( privateKey ) { return cb ( null , privateKey ) } ) } ) } catch ( err ) { return cb ( err ) } } else { try { var keyObject = keythereum . importFromFile ( ethereumAddress , ethereumDataDir ) return keythereum . recover ( ethereumAccountPassword , keyObject ) } catch ( err ) { return err } } }
get the ethereum private key for the specified ethereum account, throws exception in case of any error
@param  {String} ethereumAddress         address of the ethereum account or empty if default account
@param  {String} ethereumDataDir         absolute path of the ethereum data, defaults to ~/.ethereum
@param  {String} ethereumAccountPassword password of the specified ethereum account
@return {Buffer}                         Private key of the specified ethereum account
get the ethereum private key for the specified ethereum account throws exception in case of any error