# node-xmpp-core

> core files for the node-xmpp project

Latest version **5.0.9** (published 2017-03-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install node-xmpp-core
pnpm add node-xmpp-core
yarn add node-xmpp-core
bun add node-xmpp-core
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 5.0.9 |
| Published | 2017-03-03 |
| First published | 2013-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/node-xmpp-core) |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2277 |
| Maintainers | lloydwatkin, chris-rock, astro, sonny |
| Keywords | XMPP, JID, SRV, stanza, iq, message, presence |

## Links

- npm: https://www.npmjs.com/package/node-xmpp-core
- Repository: https://github.com/node-xmpp/node-xmpp
- Homepage: http://github.com/node-xmpp/node-xmpp
- Issues: http://github.com/node-xmpp/node-xmpp/issues
- npm.io page: https://npm.io/package/node-xmpp-core

## Dependencies (8)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [inherits](https://npm.io/package/inherits.md) ^2.0.1
- [@xmpp/jid](https://npm.io/package/@xmpp/jid.md) ^0.0.2
- [@xmpp/xml](https://npm.io/package/@xmpp/xml.md) ^0.1.3
- [lodash.assign](https://npm.io/package/lodash.assign.md) ^4.0.0
- [reconnect-core](https://npm.io/package/reconnect-core.md) https://github.com/dodo/reconnect-core/tarball/merged
- [@xmpp/streamparser](https://npm.io/package/@xmpp/streamparser.md) ^0.0.6
- [node-xmpp-tls-connect](https://npm.io/package/node-xmpp-tls-connect.md) ^1.0.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 5.0.9 (latest) — 2017-03-03
- 5.0.8 — 2017-02-14
- 5.0.7 — 2016-12-10
- 5.0.6 — 2016-12-06
- 5.0.5 — 2016-11-20
- 5.0.4 — 2016-10-16
- 5.0.3 — 2016-10-16
- 6.1.0 — 2016-06-13
- 5.0.2 — 2016-05-31
- 5.0.1 — 2016-01-12
- 5.0.0 — 2015-11-26
- 4.2.0 — 2015-11-05
- 4.1.0 — 2015-10-26
- 4.0.0 — 2015-10-20
- 3.0.0 — 2015-10-06
- … 40 more at https://npm.io/package/node-xmpp-core/versions

## README

# node-xmpp-core

Library to handle all the core functionality for:

* [node-xmpp-client](https://github.com/node-xmpp/node-xmpp-client)
* [node-xmpp-component](https://github.com/node-xmpp/node-xmpp-component)
* [node-xmpp-server](https://github.com/node-xmpp/node-xmpp-server)

[![build status](https://img.shields.io/travis/node-xmpp/node-xmpp-core/master.svg?style=flat-square)](http://travis-ci.org/node-xmpp/node-xmpp-core)
[![Coverage Status](https://img.shields.io/coveralls/node-xmpp/node-xmpp-core.svg?style=flat-square)](https://coveralls.io/r/node-xmpp/node-xmpp-core)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)

## Installation

__Note:__ We now only support Node.js versions 0.8.0 and greater.

With package manager [npm](http://npmjs.org/):

    npm install node-xmpp-core

### Testing

Install the dev dependencies, then...

```
npm test
```

Also see the tests run in [travis](http://travis-ci.org/node-xmpp/node-xmpp-core). The tests in travis run both the code and code style tests.

## How to use

Please use one of `node-xmpp-client/component/server`

## Objectives of *node-xmpp-core:*

* Use node.js conventions, especially `EventEmitter`, ie. for write
  buffer control
* Fast parsing, `node-expat` was written for this library

## Configurations

### serialized
Set this option as `true` to enable the optimization for continuous TCP streams. If your "socket" actually transports frames (WebSockets) and you can't have stanzas split across those, do not enable it.

**type:** boolean
**default:** `false`


## Features

* Simple JID parsing with Stringprep normalization
  * Optional now, you won't need ICU for just node-xmpp
  * Please be aware if you identify users by JIDs
  * `npm install node-stringprep`
* Uses [ltx](http://github.com/astro/ltx)
  * Much easier to handle than a standard DOM
  * xmlns-aware
  * Easy XML builder like Strophe.js (see down)
  * Non-buffering serialization
  * Was split out of node-xmpp for modularization and resuability

## Dependencies

* [ltx](http://github.com/node-xmpp/ltx)

Optional

* [node-stringprep](http://github.com/node-xmpp/node-stringprep): for [icu](http://icu-project.org/)-based string normalization.

Automatically building the optional library can be turned off by `npm config set optional false` or by setting the environmental variable `export NPM_CONFIG_OPTIONAL=false`. On Heroku this is done through `heroku config:set NPM_CONFIG_OPTIONAL=false`, for example.

### Building XML Elements

Strophe.js' XML Builder is very convenient for producing XMPP
stanzas. ltx includes it in a much more primitive way: the
`c()`, `cnode()` and `t()` methods can be called on any *Element*
object, returning the new child element.

This can be confusing: in the end, you will hold the last-added child
until you use `up()`, a getter for the parent. `Connection.send()`
first invokes `tree()` to retrieve the uppermost parent, the XMPP
stanza, before sending it out the wire.

# Documentation

(Builing up documentation slowly)

## JID Manipulation

...coming soon...

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