os / sys equivalent in nodejs?

Status
Not open for further replies.

griimnak

You're a slave to the money then you die
Jul 20, 2013
955
794
Essentially what i'm trying to do is clear the console after executing the app so it's nice and clean like i would with my python consoles:
NePsqO9LRCiXPTv0WUu1zg.png

in python, there's the os and sys module to communicate directly with your operating system, or emulate commands from your os etc etc.

how would i do this line in node? is there a module i can use?
Python:
os.system('cls' if os.name == 'nt' else 'clear')
I tried these:
Code:
console.log('\033[2J');

Code:
var lines = process.stdout.getWindowSize()[1];
for(var i = 0; i < lines; i++) {
   console.log('\r\n');
}
doesn't seem to work
 
Last edited:

griimnak

You're a slave to the money then you die
Jul 20, 2013
955
794
Do you want something like this?
Very useful module, but sadly i don't see something there like os.exec or console.clear

console.clear() from here doesn't seem to work for me either
 
Status
Not open for further replies.

Users who are viewing this thread

Top