5204bb7ac0
This resolves an issue arising from using both a callback and an EventEmitter together in the Client.search() API. Since the emitter would only be available through the callback, some events could be emitted before the callback is triggered, resulting in missed events. This change incorporates a test case originally by László Szűcs (@ifroz). For GH-602 |
||
---|---|---|
.github/workflows | ||
docs | ||
examples | ||
lib | ||
test | ||
test-integration/client | ||
.gitignore | ||
.npmignore | ||
.taprc | ||
CHANGES.md | ||
LICENSE | ||
README.md | ||
docker-compose.yml | ||
package.json |
README.md
LDAPjs
LDAPjs makes the LDAP protocol a first class citizen in Node.js.
Usage
For full docs, head on over to http://ldapjs.org.
var ldap = require('ldapjs');
var server = ldap.createServer();
server.search('dc=example', function(req, res, next) {
var obj = {
dn: req.dn.toString(),
attributes: {
objectclass: ['organization', 'top'],
o: 'example'
}
};
if (req.filter.matches(obj.attributes))
res.send(obj);
res.end();
});
server.listen(1389, function() {
console.log('ldapjs listening at ' + server.url);
});
To run that, assuming you've got the OpenLDAP client on your system:
ldapsearch -H ldap://localhost:1389 -x -b dc=example objectclass=*
Installation
npm install ldapjs
DTrace support is included in ldapjs. To enable it, npm install dtrace-provider
.
License
MIT.