Paperspace / paperspace-node

Paperspace API for node.js
https://www.paperspace.com/core
ISC License
75 stars 15 forks source link

refactor node sample #23

Closed robbywashere-zz closed 5 years ago

robbywashere-zz commented 5 years ago

This is a good example of using async await in your library vs callbacks.

async-await has been available since node 7.10.1

https://node.green/#ES2017-features-async-functions

Luckily, since node 8 you can use promisify, included in the stdlib under 'utils': http://2ality.com/2017/05/util-promisify.html

Please be aware I haven't tested this sample myself, so perhaps you can give it a try before merging ;)

exdx commented 5 years ago

Thanks for the PR @robbywashere ! We didn't get a chance to review and incorporate your changes in v0.1.12 but will look to do so in the subsequent release.