-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promises api #17
Promises api #17
Conversation
🍏 👍 |
|
||
mkdirp.sync(@getDir()) | ||
fs.writeFile file, data, (err) -> | ||
return reject if err? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be best to pass the error when calling reject.
Am all for this 👍 If you could get the tests working again that would be great. Thanks for your contribution! 💃 |
@4ver I've added TODO reminders and fixed some error stuff for Linux adapter. I agree with you to separate error handling to another PR 👍. Also keep in mind Promises support is for node versions >= 11.13. Don't know if you want to create a special branch/version due to incompatibility issues with previous releases. Other option would be to add a polyfill package, but IMHO I'd keep the library as simple and dependency-free as possible. Thank you for your consideration 😄 |
Sorry for the delay in getting back to you. I think we should go ahead and just use https://github.com/jakearchibald/es6-promise. It's pretty lightweight so shouldn't be much of an issue. Thanks @edulan |
Cool! I'll include es6-promise then 👍 |
What
Use ES6 Promises instead of callbacks so we can easily chain actions and handle errors.
Usage:
Concerns
Only compatible with node versions >= 11.13.