Reputation: 1
I've read all the Promise posts and still can't get this right. No matter what way I write it, I get a " Promise { }". How do I write this statement to get the promise result, not pending.
`let jws = jose.JWS.createSign({ format: 'compact', fields }, signingKey)
.update(Buffer.from(compressedPayload))
.final()
.then(function(result) {
jws = result;
});
var myjws = jws.then(function(result){ return jws});
console.log("My JWS is:", myjws)'
My JWS is: Promise { <pending> }
What am I doing wrong? Thanks
Upvotes: 0
Views: 255