Ad

Printing Data On The Same Line With PhantomJS

- 1 answer

How could I print data without a trailing newline in PhantomJS? In nodejs, i used the process to write data on the same line.

$ process.stdout.write( "Anything..." )

But i can find it's equalent in phantomJS. I've tried with PhantomJS child_process module but it returns me undefined error:

var process = require("child_subprocess");
process.stdout.write(" Anything ")

TypeError: undefined is not an object (evaluating 'process.stdout.write')

Ad

Answer

Just found it, system module is the native phantomjs module for handling stdin and stdout files. This did the task for me:

var system = require("system");
system.stdout.write("Anything...");
Ad
source: stackoverflow.com
Ad