Ticker

6/recent/ticker-posts

Header Ads Widget

Embed Command Prompt in Web Page

Today I will explain most interesting topic on node.js. It is not important that you know all about computer language but if you know or feel nothing is impossible then you can do anything today i will tell you like that type of job. This job actually how you implement or embed your server command prompt or operating system terminal in website. If you full article then you can realize that it's so easy. OK now start your job, first open your terminal and go to your application folder and type bellow command:

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

Post a Comment

0 Comments