# @xmpp/debug

> XMPP debug

Latest version **0.14.0** (published 2025-10-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @xmpp/debug
pnpm add @xmpp/debug
yarn add @xmpp/debug
bun add @xmpp/debug
```

## Health

**Score 58/100 (C)** — status: stable.

Positive: has types package; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.14.0 |
| Published | 2025-10-29 |
| First published | 2017-03-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/xmpp__debug) |
| Module format | ESM + CommonJS |
| Node | >= 20.10 |
| Dependencies | 2 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2275 |
| Maintainers | sonny |
| Keywords | XMPP, debug |

## Links

- npm: https://www.npmjs.com/package/@xmpp/debug
- Repository: https://github.com/xmppjs/xmpp.js
- Homepage: https://github.com/xmppjs/xmpp.js/tree/main/packages/debug
- Issues: http://github.com/xmppjs/xmpp.js/issues
- npm.io page: https://npm.io/package/@xmpp/debug

## Dependencies (2)

- [ltx](https://npm.io/package/ltx.md) ^3.1.2
- [@xmpp/xml](https://npm.io/package/@xmpp/xml.md) ^0.14.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.14.0 (latest) — 2025-10-29
- 0.13.5 — 2025-06-11
- 0.13.3 — 2024-12-23
- 0.13.0 — 2021-08-28
- 0.12.1 — 2021-08-22
- 0.12.0 — 2020-12-21
- 0.11.0 — 2020-02-14
- 0.10.0 — 2020-02-07
- 0.9.2 — 2020-01-02
- 0.9.1 — 2019-11-23
- 0.9.0 — 2019-11-19
- 0.8.0 — 2019-10-06
- 0.7.0 — 2019-02-03
- 0.6.0 — 2018-11-24
- 0.5.0 — 2018-10-07
- … 5 more at https://npm.io/package/@xmpp/debug/versions

## README

# debug

Prints logs and debug information to the console for an entity.

⚠️ debug makes a best effort to replace sensitive information with `<hidden xmlns="xmpp.js"/>` but be careful not to share secrets when sharing logs.

## Install

`npm install @xmpp/debug`

## Example

```js
import { client } from "@xmpp/client"; // or component, ...
import debug from "@xmpp/debug";

const xmpp = client(...);

debug(xmpp); // requires process.env.XMPP_DEBUG
// or
debug(xmpp, true); // always enabled
```

Here is an example output

```xml
status connecting
status connect
status opening
IN
 <stream:features xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
    <register xmlns="http://jabber.org/features/iq-register"/>
    <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
      <mechanism>
        SCRAM-SHA-1
      </mechanism>
      <mechanism>
        PLAIN
      </mechanism>
    </mechanisms>
  </stream:features>
status open <open version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" xml:lang="en" id="5217eba8-57d3-4477-947b-76b9e4abe85b" from="localhost"/>
OUT
 <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">
    <hidden xmlns="xmpp.js"/>
  </auth>
IN
 <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <hidden xmlns="xmpp.js"/>
  </challenge>
OUT
 <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">
    <hidden xmlns="xmpp.js"/>
  </response>
IN
 <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <hidden xmlns="xmpp.js"/>
  </success>
status opening
IN
 <stream:features xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
    <ver xmlns="urn:xmpp:features:rosterver"/>
    <c ver="tRnaQYpc52X5dPpqfBVx/AQoDrU=" xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://prosody.im"/>
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <required/>
    </bind>
    <session xmlns="urn:ietf:params:xml:ns:xmpp-session">
      <optional/>
    </session>
  </stream:features>
status open <open version="1.0" xmlns="urn:ietf:params:xml:ns:xmpp-framing" xml:lang="en" id="6b387d87-881b-4151-bcbf-a55bc621e25f" from="localhost"/>
OUT
 <iq type="set" id="h9zf631uek" xmlns="jabber:client">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <resource>
        example
      </resource>
    </bind>
  </iq>
IN
 <iq id="h9zf631uek" xmlns="jabber:client" type="result">
    <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
      <jid>
        username@localhost/example
      </jid>
    </bind>
  </iq>
status online username@localhost/example
online as username@localhost/example
OUT
 <presence xmlns="jabber:client"/>
OUT
 <message type="chat" to="username@localhost/example" xmlns="jabber:client">
    <body xmlns="hello world"/>
  </message>
IN
 <presence from="username@localhost/example" xmlns="jabber:client"/>
IN
 <message from="username@localhost/example" to="username@localhost/example" xmlns="jabber:client" type="chat">
    <body xmlns="hello world"/>
  </message>
OUT
 <presence type="unavailable" xmlns="jabber:client"/>
status closing
IN
 <presence from="username@localhost/example" xmlns="jabber:client" type="unavailable"/>
status close <close xmlns="urn:ietf:params:xml:ns:xmpp-framing"/>
status disconnecting
status disconnect [object Object]
status offline <close xmlns="urn:ietf:params:xml:ns:xmpp-framing"/>
offline
```

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