sudo npm install tty.js
After few minute you will see tty.js installed then create a file like shell.js beside of node_module folder and and open in editor and copy bellow command in this file:
var tty = require('tty.js');
var app = tty.createServer({
shell: 'bash',
users: {
foo: 'bar'
},
port: 8000
});
app.listen();
After copy type bellow command in terminal:
node shell
Next open your browser and type http://localhost:8000 in address bar and press enter then open a window where give your system name and password and next open a webpage and you can see two button in right side
and click on open terminal button and then open a terminal



Ok now you have created a web console if want to change html then goto node_module folder and next tty.js folder next static folder and where you will see a index.html file and open it in your editor and change anything what you want
Ok now you have know how you implement/embed a command prompt in website.
If i got more time then i will give you more better and flexible command prompt
0 Comments