Dockerode: How about promisfying the APIs?

Created on 25 Sep 2016  路  7Comments  路  Source: apocas/dockerode

enhancement

Most helpful comment

Done :)
Thanks for the feedback!

All 7 comments

Duplicate of #171
As recommended in #171, https://www.npmjs.com/package/dockerode-promise

Got it. I think this can be noted somewhere. Thanks anyway!

Just pushed to the repo a promise based interface, check it out :)

@apocas Great work! Thank you!

Em... In some cases, I prefer another promise library instead of the native one, e.g. bluebird. Could you enable users to plug in their favourite promise library?

I think that can be achieved like this:

Users pass their promise library to Docker:

const docker = new Docker({
  socketPath: '...',
  Promise: require('bluebird')
})

then the constructer can save it in the Modem instance

Docker() {
...
  this.modem.Promise = opts.Promise || global.Promise
...
}

After that, just replace return new Promise() with return new this.modem.Promise().

Humm, interesting :)

Yes this is a good idea.

Done :)
Thanks for the feedback!

@apocas Great! I can't wait for its publication to NPM!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nuest picture nuest  路  3Comments

yamii picture yamii  路  5Comments

gaetsd picture gaetsd  路  3Comments

zigmund picture zigmund  路  3Comments

mhemrg picture mhemrg  路  4Comments