It's not obvious whether this runs off the main loop, with any concurrency, etc.  I had a peek at your scrypt-hash lib and it looks like it's using a background worker of some kind, maybe worth a few words here to clarify.