rl-socket-client
v0.1.8
Published
the readline socket client
Downloads
7
Maintainers
Readme
rl-socket-client: the readline socket client
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 givenhost
andport
#on(event)
: currently the only event emitted isconnected
#write(text)
: programmatically sendtext
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...');
});