Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export filters #1

Open
felixfbecker opened this issue Oct 3, 2015 · 3 comments
Open

Export filters #1

felixfbecker opened this issue Oct 3, 2015 · 3 comments

Comments

@felixfbecker
Copy link

First of all, this module is great. Using vanilla ldap with ES7 async/await was a pain in the ***.
I only got one problem, which requires me to include vanilla ldap as dependency too - you don't export the filters (and probably some other things neither like the errors). I think it would also be better to export the client seperatly (because you might add server support) at some point e.g. module.exports = {Client, Server, ...filters}. I also don't quite get why you create your own Client class and not just inherit the the ldap class, but overwrite all methods to return promises.
What do you think?
I would create a PR if you agree.

@felixfbecker
Copy link
Author

PS: I think it would be the best to only return a promise if no callback is passed. That way you don't have to expose _search, because with a callback the function would just behave like in vanialla ldapjs.

@sjmeverett
Copy link
Owner

Thanks for the feedback. Creating a new class to wrap the existing class is the adapter pattern and is arguably better design than duck punching the existing class.

I guess I did think about exporting it separately, I can't remember why I didn't. Seems like a good idea really.

I'm not sure what you mean about the filters. Feel free to submit a PR and we'll talk about it there!

Thanks.

@felixfbecker
Copy link
Author

Working on it!
Some questions though:

  • What coding style do you follow? It would be nice to have a .eslintrc
  • Can I use ES6 features?
  • What about tests? Is mocha okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants