Closed jcreager closed 7 years ago
Hi @jcreager, apologies for the response time.
The module is entirely synchronous and doesn't offer an asynchronous option. One could be added in the future but as of right now, we only use sync methods and don't use any callbacks.
Sorry if that's confusing. I'll try and fix your confusion:
console.log in this example returns undefined
It will return undefined — it'll print the password to the console. password
is where the value is.
The password is logged to the console as expected rather than undefined.
The module code doesn't support any async stuff, so that shouldn't — and doesn't — work. The function doesn't even accept a callback parameter.
self.generate method actually does return a callback
It does not. The inner generate
will always return a string.
Did that clear it all up?
Hi @brendanashworth
I hope this isn't a silly question. I am wondering if I am missing something in the readme for this module? It looks like the example code is synchronous:
However, console.log in this example returns undefined rather than the password. If I modify the code by passing a callback function as follows:
The password is logged to the console as expected rather than undefined.
I dug a little deeper and it looks like the self.generate method actually does return a callback:
That said, I do not see any open issues for your library pertaining to the issue that I have encountered. I am hoping to verify with you if I am missing something else, or if I am on the right track with this being an async module?
Thank you, Joe