node-activedirectory icon indicating copy to clipboard operation
node-activedirectory copied to clipboard

Promises?

Open cope opened this issue 7 years ago • 3 comments

Do you plan to replace callbacks with (or just add) promises?

Or do you know any promisifying solutions that work with node-activedirectory?

I tried util.promisify on the getUsersForGroup method, but that throws the self.findGroup is not a function error :(

cope avatar Mar 20 '18 15:03 cope

See issue 189 (https://github.com/gheeres/node-activedirectory/issues/189). Forked it and started on rebuilding it a little bit. Looks like it would solve some problems.

relief-melone avatar Aug 02 '18 06:08 relief-melone

Allright. Back from vacation.

Voila. Still a work in progress. But should at least work with code that is implemented with the original module and promises are in it too. If you find any issues it woudl be great if you reported them https://www.npmjs.com/package/ad-promise

relief-melone avatar Aug 17 '18 12:08 relief-melone

I'm not sure how they implemented util.promisify but it won't work with node-activedirectory. The callback has the correct structure for util.promisify (err, res) but it loses the config, hence you lose the communication with the AD. What you can do in the meanwhile is wrapping the methods you need from node-activedirectory with a promise.

yoavke avatar Dec 06 '21 08:12 yoavke