Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
// npm install -g shelljs
// sudo apt-get install socat
require('shelljs/global');
setInterval(function(){
for (var i = 0; i < 10; i++)
exec("echo 'process' | socat - UNIX-CONNECT:/tmp/noderepl.sock", {async: true})
}, 10)
// shjs client.js
var repl = require('repl')
var net = require('net')
var fs = require('fs')
var sockpath = '/tmp/noderepl.sock'
process.on('uncaughtException', function(err) {
console.log(err.stack)
})
fs.unlink(sockpath, function() {
net.createServer(function (socket) {
var r = repl.start({
prompt: 'yippee ki yay '
, input: socket
, output: socket
, terminal: true
, useGlobal: false
})
r.on('exit', function () {
socket.end()
})
r.context.socket = socket
r.context.big = new Buffer(1000)
}).listen(sockpath)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.