asyncify
The asyncify deferred module of FuturesJS (Ender.JS and Node.JS)
Last updated 15 years ago .
Repository · Original npm · Tarball · package.json
$ cnpm install asyncify 
SYNC missed versions from official npm registry.

asyncify()

  • doStuff = Futures.asyncify(doStuffSync) - returns a fuction with the same signature which catches errors and returns a future rather than the synchronous data.

Example:

function doStuffSync = function (params) {
  throw new Error("Error of some sort");
  return "Hello";
}

var doStuff = Futures.asyncify(doStuffSync);

doStuff.whenever(function (err, data) {
  console.log(err, data);
});

doStuff();
doStuff();
doStuff().when(function (err, data) {
  if (err) {
    throw err;
  }
  console.log(data);
});

Current Tags

  • 2.1.2                                ...           latest (12 years ago)

2 Versions

  • 2.1.2                                ...           12 years ago
  • 2.1.1                                ...           15 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |