mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 17:35:34 +00:00
chore(repl) es2015-ify
This commit is contained in:
parent
86d1b4929e
commit
cffc96ca8a
1 changed files with 10 additions and 11 deletions
|
|
@ -1,23 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
var net = require('net'),
|
||||
repl = require('repl'),
|
||||
rendy = require('rendy');
|
||||
const net = require('net');
|
||||
const repl = require('repl');
|
||||
|
||||
module.exports = net.createServer(function (socket) {
|
||||
var r = repl.start({
|
||||
prompt: rendy('[{{ pid }} {{ addr }}:{{ port}}>', {
|
||||
pid : process.pid,
|
||||
addr : socket.remoteAddress,
|
||||
port : socket.remotePort
|
||||
}),
|
||||
module.exports = net.createServer((socket) => {
|
||||
const pid = process.pid;
|
||||
const addr = socket.remoteAddress;
|
||||
const port = socket.remotePort;
|
||||
|
||||
const r = repl.start({
|
||||
prompt: `[${pid} ${addr}:${port}>`,
|
||||
input: socket,
|
||||
output: socket,
|
||||
terminal: true,
|
||||
useGlobal: false
|
||||
});
|
||||
|
||||
r.on('exit', function () {
|
||||
r.on('exit', () => {
|
||||
socket.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue