LDAP Client and Server API for node.js
Go to file
Trent Mick 6df426b21d Update dtrace-provider to fix build on Snow Leopard
https://github.com/chrisa/node-dtrace-provider/issues/21
2012-09-24 09:00:42 -07:00
bin client-side support for paged search 2012-09-19 16:39:31 -04:00
deps lint/style cleanup and build support updates 2012-09-20 19:38:46 +00:00
docs update supported node.js version 2012-05-13 10:36:17 +03:00
examples Client refactor, with pooled client (minor lint cleanup as well) 2012-04-26 20:23:43 -07:00
lib lint/style cleanup and build support updates 2012-09-20 19:38:46 +00:00
test Bad event handling, and working with node 0.8 2012-07-09 13:00:51 +00:00
tools lint/style cleanup and build support updates 2012-09-20 19:38:46 +00:00
.dir-locals.el Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
.gitignore missing Makefile.targ due to gitignore 2012-02-18 08:18:42 +00:00
.gitmodules Initial setup for 0.5 (use eng.git layout) 2012-02-18 08:15:52 +00:00
.travis.yml travis broken 2012-02-18 08:26:50 +00:00
LICENSE Initial working client/server version 2011-08-04 13:32:01 -07:00
Makefile lint/style cleanup and build support updates 2012-09-20 19:38:46 +00:00
README.md tabs in README 2011-11-10 10:15:26 -08:00
package.json Update dtrace-provider to fix build on Snow Leopard 2012-09-24 09:00:42 -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.