jsreport / nodejs-client

Nodejs remote client for jsreport
MIT License
4 stars 3 forks source link

Promises #2

Open zam6ak opened 8 years ago

zam6ak commented 8 years ago

Any plans on adding Promises to nodejs-client? Example:

var client = require("jsreport-client")(url, username, password);
client
.render({template: {...}}, {timeout: 1000})
.then( (response) => {
  return response.pipe(res); // res is Express response
})
.catch((err) => {
  console.log(err);
  return next(err); //Express error handler
});
pofider commented 8 years ago

You can always promisify it with your promise library, or not?