Skip to content

Instantly share code, notes, and snippets.

@manast
Created June 13, 2013 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manast/5775455 to your computer and use it in GitHub Desktop.
Save manast/5775455 to your computer and use it in GitHub Desktop.
Continuable vs Promises
// ES6 syntax
var target = yield fs.readlink("/path/to/symlink");
// ES5 syntax
fs.readlink("/path/to/symlink")(function (err, target) {
if (err) throw err;
// do something with target
});
// Promised based
fs.readlink("/path/to/symlink").then(function (target) {
// do something with target
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment