New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rtt-buffer

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtt-buffer

Realtime Text Buffer

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
16
77.78%
Maintainers
2
Weekly downloads
 
Created
Source

RTT-Buffer

Input and display Realtime Text

What is this?

The rtt-buffer module provides a DisplayBuffer and InputBuffer for tracking the state of incoming or outgoing realtime text, and for generating the proper edit actions to send.

What is Realtime Text?

Realtime text is text that is broadcast as you type, so that others can follow the conversation without waiting.

Supporting realtime text (RTT) provides valuable accessibility support to people with disabilities (e.g deaf or hard-of-hearing), facilitating higher bandwidth conversations.

For more information about realtime text, see realtimetext.org.

Installing

$ npm install rtt-buffer 

Building bundled/minified version (for AMD, etc)

$ grunt

The bundled and minified files will be in the generated build directory.

Usage

var rtt = require('rtt-buffer');

var display = new rtt.DisplayBuffer();

// Update the display state based on an RTT event
var rttEvent = {
    event: 'edit',
    actions: [
        { type: 'insert', text: 'Tea'},
        { type: 'wait', num: 32},
        { type: 'erase', num: 1},
        { type: 'wait', num: 28},
        { type: 'insert', text: 'st'}
    ]
};
display.process(rttEvent);

The display.text field can be bound to a template to render the incoming text.

var input = new rtt.InputBuffer();

// Whenever the input source changes
input.update("New full text of message");

// Generate an RTT event based on changes since the last event.
var rttEvent = input.diff();

License

MIT

Created By

If you like this, follow @lancestout on twitter.

Keywords

xmpp

FAQs

Package last updated on 03 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts