# @simulacrum/ldap-simulator

> Run local LDAP server with specific users for local development and integration testing

Latest version **0.5.5** (published 2023-09-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @simulacrum/ldap-simulator
pnpm add @simulacrum/ldap-simulator
yarn add @simulacrum/ldap-simulator
bun add @simulacrum/ldap-simulator
```

Provides the command `ldap-simulator`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.5 |
| Published | 2023-09-08 |
| First published | 2021-10-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 46 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | frontsidejack |
| Keywords | simulation, LDAP, emulation, mock, mocking, stubbing, integration testing |

## Links

- npm: https://www.npmjs.com/package/@simulacrum/ldap-simulator
- npm.io page: https://npm.io/package/@simulacrum/ldap-simulator

## Dependencies (4)

- [ldapjs](https://npm.io/package/ldapjs.md) ^2.3.1
- [get-port](https://npm.io/package/get-port.md) 5.1.1
- [seedrandom](https://npm.io/package/seedrandom.md) ^3.0.5
- [@simulacrum/server](https://npm.io/package/@simulacrum/server.md) ^0.4.0

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@crvouga/mockingbird-service-paddle](https://npm.io/package/@crvouga/mockingbird-service-paddle.md) — 0 weekly downloads
- [odata-prova](https://npm.io/package/odata-prova.md) — 0 weekly downloads
- [@jota-one/drosse](https://npm.io/package/@jota-one/drosse.md) — 0 weekly downloads

## Recent versions

- 0.5.5 (latest) — 2023-09-08
- 0.5.4 — 2022-11-28
- 0.5.3 — 2022-10-12
- 0.5.2 — 2022-08-25
- 0.5.1 — 2022-04-14
- 0.5.0 — 2022-04-13
- 0.4.0 — 2022-04-07
- 0.3.2 — 2022-04-01
- 0.3.1 — 2022-03-21
- 0.3.0 — 2022-03-15
- 0.2.3 — 2022-03-14
- 0.2.2 — 2022-01-19
- 0.2.1 — 2022-01-06
- 0.2.0 — 2021-10-19

## README

# @simulacrum/ldap-simulator

Simulate an actual LDAP server for testing and development.

Often you are working on software that depends on the presence of an
LDAP directory. This let's you create an LDAP server in a known state
that can be used for offline development and testing.

There are two different ways to start an LDAP simulator, but they both involve
the same set of options. If you are running in a vanilla JavaScript
environment, you can use promise-based API.

## Plain JavaScript

```js
import { runLDAPServer } from "@simulacrum/ldap-simulator";

async function run() {
  let server = await runLDAPServer({
    port: 3890,
    baseDN: "ou=users,dc=org.com",
    bindDn: "admin@org.com",
    bindPassword: "password",
    groupDN:"ou=groups,dc=org.com",
    users: [{
      //required
      cn: 'Charles Lowell',
      //optional to bind using this user
      password: "super-secret-but-not-really",
      //optional:
      uid: 'cowboyd',

    }]
  });
  console.log(`LDAP server running on ${server.port}`);
  try {
    //.... do some stuff;
  } finally {
    // don't forget to release the server resources!
    await server.close();
  }
}
```

## Effection

However, if you are already using [Effection][effection], the LDAP
server is available as a [Resource][resource], and so you can use it
freely in any context:

```js
import { createLDAPServer } from "@simulacrum/ldap-simulator";

function* run() {
  let server = yield createLDAPServer({
    port: 3890,
    baseDN: "ou=users,dc=org.com",
    bindDn: "admin@org.com",
    bindPassword: "password",
    groupDN:"ou=groups,dc=org.com",
    users: [{
      //required
      cn: 'Charles Lowell',
      //optional to bind using this user
      password: "super-secret-but-not-really",
      //optional:
      uid: 'cowboyd',

    }]
  });

  //... do some stuff
}
```

[effection]: https://frontside.com/effection
[resource]: https://frontside.com/effection/docs/guides/resources

---
_Source: https://npm.io/package/@simulacrum/ldap-simulator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
