dachev / node-cld

Language detection for Javascript (Node). Based on the CLD2 (Compact Language Detector) library from Google.
Apache License 2.0
317 stars 55 forks source link

Rewrite cld to actually be async with a promise API #62

Closed implausible closed 4 years ago

implausible commented 4 years ago

It looks like it might be beneficial for electron-spellchecker for this library to have a true async API. See https://github.com/electron-userland/electron-spellchecker/pull/170.

Since we were already using the node callback pattern, most users have been promisifying this call anyway. I've preserved the callback API so that it should not be a breaking change (unless someone depended on the implementation actually being synchronous).

dachev commented 4 years ago

@implausible this is looking great! Would you mind updating the README to emphasize modern syntax? I would change the Simple and Advanced examples and add a new section Legacy with a callback example.

implausible commented 4 years ago

@dachev Sure can. I have updated the documentation. Let me know if you have any additional requests!

dachev commented 4 years ago

Beautiful! Thank you @implausible