mikeal / node.couchapp.js

Utility for writing couchapps.
Apache License 2.0
406 stars 78 forks source link

push same doc to multiple dbs #104

Open osher opened 9 years ago

osher commented 9 years ago

Hi, I've wrapped this tool in my CI flow, and so far we're communicating with it through child_process.exec, which is combersome a little, but works.

I was trying to rewrite the part, and was hoping to do something of the spirit of:

var couchapp = require('couchapp');

async.waterfall( 
   [ couchapp.createApp.bind( pathToFile )
   , function(app, next)  { 
         async.parallel( arrDbUrls, app.push, next)         
     }
   ]
, done
)

but was surprised to see that it's not possible! the url is provided already to the couchapp.createApp - which means that if I want to push it to N integration envs I have to createApp N times....

I would like to check with you if I can work on a pull request that will not change the CLI interface, but will make this difference for API on the main module.

Ah, I also learnt that the tool throws errors instead of passing them to callbacks... (tsk, tsk, tsk :disappointed:) so I can fix that too in the same PR, if that's OK with you :smile:

Thanks, O

osher commented 9 years ago

See here: :smile: https://github.com/mikeal/node.couchapp.js/pull/105