npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openldapjs

v1.1.1

Published

A ldap client nodejs

Downloads

12

Readme

OpenLDAP.JS

Build Status Development

Build Status Master

Node.js wrapper for OpenLDAP. This library allows you to interact through Node.js with a LDAP backend.

Getting Started

  • Clone or download repository.
  • Install dependencies.
  • V8 Embedder's guide Useful documentation + examples if you want a deeper look at how embedding is done.
  • Nan Nan examples, documentation and source.
  • LDAP & OpenLDAP documentation and resources.

Prerequisites

  • Install all dependencies :
    • Node.js(>version 4.8.5)
    • NPM
    • OpenLDAP libraries
    • Nan
    • V8

Why a new library?

Previous implementations lacked certain details such as extended operations' post/pre read which is something we needed dearly. Additionally, other libraries re-implemented the entire protocol (or rather chunks of it) and held the door open for various errors. Relying on the standard openldap C libraries should allow us to be more compatible with openldap servers than other libraries. Adding missing function calls to the interface should be easy due to pre-existing examples and not having to worry about the implementation on the protocol.

Building

OpenLDAP.js requires OpenLDAP development libraries.

Debian/Ubuntu

  • OpenLDAP development libraries : sudo apt-get install libldap2-dev currently built with Openldap 2.4.45.
  • Make sure you have python2.7 and node-gyp installed. Run npm install, it should install dependencies and build the c++ source files.

MacOs

  • N/a yet.

Windows

  • N/a yet.

Testing

For the tests to run, you'll need some sample test data. In order to do this manually edit the ldapAuthentication section of the config file and configure your local ldap data :

  • host: address of your ldap server, E.g: ldap://localhost:389

  • userDn: LDAP login Dn, this will be used for authentication. E.g: cn=admin,dc=demoApp,dc=com

  • userPassword: Password for your userDn

Also, configure the ldapTestEntries section in order to tell it where to put the test data:

  • entryDn: Entry point for your test data, E.g: cn=newPoint,o=myhost,dc=demoApp,dc=com

Make sure the user you're providing has sufficient rights (read/write).

After you're done configuring, run npm run addData, this should add 10k test entries to your ldap Server.

After the sample data is ready, run npm test and the tests should run.

npm test

Test breakdown

The tests are mainly designed for testing all ldap routines (add,delete,search,modify, initialize,bind, unbind, start tls, etc.). Test suite is composed of integration + unit tests.

Deployment

Clone or download the repository. Get all required packages with npm and build the addon files : npm install

The Node.JS wrapper for the library is libs/ldap_async_wrap.js, require it in your software like :

const LdapClient = require('openldapjs').Client;

A normal workflow would be :

const ldapClientInstance = new LdapClient('ldap://your_ldap_server:PORT');

ldapClientInstance.initialize()
    .then(() => {
      return ldapClientInstance.bind(userDn,userPassword)
    })
    .then( () => {
      ldapClientInstance.search(...);
      ldapClientInstance.add(...);
      ldapClientInstance.delete(...);
      ldapClientInstance.modify(...);
    });

For more in depth examples please consult Tests and Samples.

Built With

Contributing

This project follows the airbnb lint rules for javascript and Clang google style for the C/C++ addon files. For easier collaboration, please ensure that your code is properly linted/formated before submitting a pull request.

Any pull requests or issue reports are appreciated.

Authors

Reviewers:

Developers:

See also the list of contributors who participated in this project.

License

  • This Project is published under the MIT License
  • All references: Licenses in use

Acknowledgments