use child_process to create a terminal

35 views
Skip to first unread message

EL HEDADI Youssef

unread,
Mar 18, 2018, 12:36:58 PM3/18/18
to nodejs
Hello.
firstly sorry for my bad english :) .
can any one help me with this probelem. 
i want ot create a kind of terminal in linux with nodeJs 
for exemple use sqlite3 from shell ( i don't want use node s modules like node-sqlite3 or others) and give me the possibilite to re send others command with the same instance.
--> exemple:
 1- run--> sqlite3 
2- after receive result re-send commande to open DB (.open /db/db.sqlite).
3- run query,  for exemple :
      select * from table A;
      select * from table B

i already try with child_process but when i used from multiple js file i get multi sqlite3 instance open and cpu up to 80-100%

Murukesh Sadasivan

unread,
Mar 19, 2018, 9:06:58 AM3/19/18
to nodejs
Try this thread, it may be what you want.. 

https://stackoverflow.com/questions/8128578/reading-value-from-console-interactively

If you want to get fancy with web based interface, you can do it with terminal emulators like https://github.com/Gottox/terminal.js (simple) and https://github.com/xtermjs/xterm.js (more complex) along with websockets. You can also get fancier with docker instances, but thats probably for another day!
Reply all
Reply to author
Forward
0 new messages