Re:Hard-won lessons: Five years with Node.js
by Rapzid on Thursday April 20, 2017 @12:30AM
(#14153982)
This is changing pretty steadily. For example, the AWS SDK has TypeScript types packaged now and a promise interface. Compare this the boto3, the Python SDK, which has had a story open for years(?) to add async support with no official solution.
Node.js's own libraries are a mix of events and callbacks. Some of it can been "promisified", however they have yet to start a real async conversion AFAIK. I've had to wrap some of this stuff to create async interfaces for my own code.
Re:Hard-won lessons: Five years with Node.js
by koolba on Wednesday April 19, 2017 @11:01PM
(#14153581)
Not really but I also don't see it as that much of a problem. The libraries I use either provide a Promise based interface or I've written my own as a thin veneer atop a callback interface.
Ditto for apply your own types atop the results. Most are already there and only a few edge cases need to be added.
Re:Hard-won lessons: Five years with Node.js
by pyrophane on Wednesday April 19, 2017 @11:14PM
(#14153633)
I had a somewhat different experience. Most of the libraries I used lacked types in the library itself. There were types provided by DefinitelyTyped, but they were often incomplete or out of date, and I think a wrong type definition can be worse than none at all.
As far as writing your own types on top of those libraries, how do you ensure any amount of correctness?
Am I missing something important here?
Is there any better workaround to that these days?