mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(repl) add rendy
This commit is contained in:
parent
c4a50f97d6
commit
a8f8ad14ca
1 changed files with 8 additions and 3 deletions
|
|
@ -1,12 +1,17 @@
|
|||
(function() {
|
||||
'use strict';
|
||||
|
||||
var repl = require('repl'),
|
||||
net = require('net');
|
||||
var net = require('net'),
|
||||
repl = require('repl'),
|
||||
rendy = require('rendy');
|
||||
|
||||
module.exports = net.createServer(function (socket) {
|
||||
var r = repl.start({
|
||||
prompt: '[' + process.pid + '] ' +socket.remoteAddress+':'+socket.remotePort+'> ',
|
||||
prompt: rendy('[{{ pid }} {{ addr }}:{{ port}}>', {
|
||||
pid : process.pid,
|
||||
addr : socket.remoteAddress,
|
||||
port : socket.remotePort,
|
||||
}),
|
||||
input: socket,
|
||||
output: socket,
|
||||
terminal: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue