# @mongodb-js/saslprep

> SASLprep: Stringprep Profile for User Names and Passwords, rfc4013

Latest version **1.5.4** (published 2026-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mongodb-js/saslprep
pnpm add @mongodb-js/saslprep
yarn add @mongodb-js/saslprep
bun add @mongodb-js/saslprep
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.5.4 |
| Published | 2026-09-09 |
| First published | 2023-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 633.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 24 |
| Author | Dmitry Tsvettsikh |
| Maintainers | satyasinha, kristina.stefano, jarjee, devtoolsbot, mongo-j, nbbeeken, dbx-node, devtools-npm-user |
| Keywords | sasl, saslprep, stringprep, rfc4013, 4013 |

## Links

- npm: https://www.npmjs.com/package/@mongodb-js/saslprep
- Repository: https://github.com/mongodb-js/devtools-shared
- Homepage: https://github.com/mongodb-js/devtools-shared/tree/main/packages/saslprep
- Issues: https://jira.mongodb.org/projects/COMPASS/issues
- npm.io page: https://npm.io/package/@mongodb-js/saslprep

## Dependencies (1)

- [sparse-bitfield](https://npm.io/package/sparse-bitfield.md) ^3.0.3

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.5.4 (latest) — 2026-09-09
- 1.5.3 — 2026-09-09
- 1.5.2 — 2026-09-07
- 1.5.1 — 2026-09-07
- 1.5.0 — 2026-08-19
- 1.4.13 — 2026-07-24
- 1.4.12 — 2026-06-30
- 1.4.11 — 2026-05-03
- 1.4.10 — 2026-05-01
- 1.4.9 — 2026-04-23
- 1.4.8 — 2026-04-16
- 1.4.7 — 2026-04-16
- 1.4.6 — 2026-02-11
- 1.4.5 — 2026-01-19
- 1.4.4 — 2025-12-17
- … 17 more at https://npm.io/package/@mongodb-js/saslprep/versions

## README

# saslprep

_Note: This is a fork of the original [`saslprep`](https://www.npmjs.com/package/saslprep) npm package
and provides equivalent functionality._

Stringprep Profile for User Names and Passwords, [rfc4013](https://tools.ietf.org/html/rfc4013)

### Usage

```js
const saslprep = require('@mongodb-js/saslprep');

saslprep('password\u00AD'); // password
saslprep('password\u0007'); // Error: prohibited character
```

### API

##### `saslprep(input: String, opts: Options): String`

Normalize user name or password.

##### `Options.allowUnassigned: bool`

A special behavior for unassigned code points, see https://tools.ietf.org/html/rfc4013#section-2.5. Disabled by default.

## License

MIT, 2017-2019 (c) Dmitriy Tsvettsikh

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