Skip to content

Instantly share code, notes, and snippets.

@MauricevanLeeuwen
MauricevanLeeuwen / repl.js
Last active August 13, 2021 05:24
Use a nodejs repl socket with socat, with correct behaviour of terminal colors, arrow keys, tab key, \r\n on stdout
const repl = require('repl');
const net = require('net');
net.createServer((socket)=>{
var r= repl.start({
prompt: '> ',
input: socket,
output: socket,
terminal: true,
useGlobal: false