You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use a promise-based API in my fork as well as the callback-based one
constkeygen=require('@micalevisk/ssh-keygen')asyncfunctionrunPromiseVersion(){console.log('Generating key pair')try{constout=awaitkeygen({comment: 'john@doe.com',read: true,});// just supply the second parameter here (as usual) if you don't want to return a Promiseconsole.log('Done generating key pairs');console.log(out.key);console.log(out.pubKey);}catch(err){console.log('There was a problem:',err);}}
it doesn't have any dependencies.
ericvicenti
changed the title
async problem
Support for Promises, (async/await)
Jun 14, 2023
keygen function is normal function not Promise or async function. I confused for a while and realized it may want some async methods.
code
result
The text was updated successfully, but these errors were encountered: