# tuio-extended

> Improvement of the original Tuio.js library to support basic features of the TUIO2 protocol. A small subset of the features is supported, and it is questionable if everything will be implemented.

Latest version **1.0.0** (published 2018-04-27) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install tuio-extended
pnpm add tuio-extended
yarn add tuio-extended
bun add tuio-extended
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-04-27 |
| First published | 2015-12-07 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 (+9 in 2 direct dependencies) |
| Install scripts | no |
| Author | Felix Raab |
| Maintainers | nomve |

## Links

- npm: https://www.npmjs.com/package/tuio-extended
- Repository: https://github.com/nomve/Tuio.js
- Homepage: http://fe9lix.github.com/Tuio.js/
- Issues: https://github.com/nomve/Tuio.js/issues
- npm.io page: https://npm.io/package/tuio-extended

## Dependencies (4)

- [ws](https://npm.io/package/ws.md) ~0.8.0
- [long](https://npm.io/package/long.md) ^4.0.0
- [slip](https://npm.io/package/slip.md) ^1.0.2
- [lodash](https://npm.io/package/lodash.md) ~3.10.1

## Recent versions

- 1.0.0 (latest) — 2018-04-27
- 0.1.5 — 2016-03-14
- 0.1.4 — 2016-03-07
- 0.1.3 — 2016-01-12
- 0.1.2 — 2016-01-04
- 0.1.1 — 2015-12-11
- 0.1.0 — 2015-12-07

## README

[![Build Status](https://travis-ci.org/nomve/Tuio.js.svg?branch=master)](https://travis-ci.org/nomve/Tuio.js)

# Tuio-extended.js

This is a fork of [Tuio.js](https://github.com/fe9lix/Tuio.js), the original JavaScript implementation of the TUIO protocol.

Tuio-extended.js supports a very basic subset of the [TUIO2 protocol](tuio.org/?tuio20), namely the the pointer (PTR) and token (TOK) components. They are currently not completely implemented.

Because the [reference C++](https://github.com/mkalten/TUIO20_CPP) implementation of TUIO2 supports  WebSockets on the TuioServer, Tuio-extended also has a number of other changes:

* it decodes the TUIO OSC messages using [osc.js](https://github.com/colinbdclark/osc.js), instead of using a local Node server
* the socket.io connection from the browser to a local Node server that relays the UDP messages to the browser is no longer needed
* if necessary for the original TUIO (v1) protocol, the Node Server is still available using `src/server.js`. Internally it uses the [ws package](https://github.com/websockets/ws) instead of socket.io. Run it with: `node src/server.js`. It listens to `localhost:3333` for Tuio messages over UDP, and sends over `localhost:5000` for WebSocket connections.

## Installation
Install with npm
```
npm install tuio-extended
```

## Usage with Tuio2
The usage is the same as in [the original library](https://github.com/fe9lix/Tuio.js), but it offers two new methods in `TuioClient` for retrieving the two new input types. The one significant difference is that they give an array of pointer of token objects, instead of a JavaScript object. For instance:
```
var client = new TuioClient({host: 'ws://connection'});

client.on('refresh', function() {
  var pointers = client.getTuioPointers();
  var tokens = client.getTuioTokens();
  // they can be iterated
  pointers.forEach(...);
  tokens.forEach(...);
});
```

## License
Licensed under the GPL license.

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