rl-socket-client

0.1.8 • Public • Published

rl-socket-client: the readline socket client

Build Status Coverage Status NPM

we ought to just pretend it stands for rocketlauncher-socket-client. that's way cooler, right?

this module was designed for apps that require a basic tty interface for socket programs - a tcp chat client, for instance. it affords tab-completion and a simple api.

api

  • #connect(): initiate a connection to the given host and port
  • #on(event): currently the only event emitted is connected
  • #write(text): programmatically send text over the wire

usage

var rlsc = require('rl-socket-client');
 
new rlsc({
    host: '192.168.128.100',
    port: 1829,
    prompt: '',
    lineEnding: '\n',
    connect: true,
    completions: ['ls', 'pwd', 'cat', 'echo']
});
 
// or
 
var client = new rlsc({
    host: '192.168.128.100',
    port: 1829
}).connect();
 
client.on('connected', function() {
    client.write('blah blah...');
});

Package Sidebar

Install

npm i rl-socket-client

Weekly Downloads

0

Version

0.1.8

License

MIT

Last publish

Collaborators

  • skibz