LDAP Client and Server API for node.js
Go to file
Jeff Huff e99ee3c75e Changed log_stub format to increment the UTC month number because UTC is 0 - 11 not 1 - 12 month numbers 2011-08-30 21:04:43 -07:00
docs Include @dresende's address book in examples 2011-08-29 13:59:46 -07:00
lib Changed log_stub format to increment the UTC month number because UTC is 0 - 11 not 1 - 12 month numbers 2011-08-30 21:04:43 -07:00
tst Fix up client to work in all cases (UDS and TCP) 2011-08-26 16:33:49 -07:00
.gitignore Documentation and makefile 2011-08-15 10:53:57 -07:00
LICENSE Initial working client/server version 2011-08-04 13:32:01 -07:00
Makefile Docs and anonymous bind support 2011-08-24 12:38:23 -07:00
README.md minor doc/readme update 2011-08-24 21:46:31 -07:00
package.json Fix up client to work in all cases (UDS and TCP) 2011-08-26 16:33:49 -07:00

README.md

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

License

MIT.

Bugs

See https://github.com/mcavage/node-ldapjs/issues.