Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
REMitchell
GitHub Repository: REMitchell/python-crawling
Path: blob/master/6-Selenium/phantomjs/examples/stdin-stdout-stderr.js
164 views
1
var system = require('system');
2
3
system.stdout.write('Hello, system.stdout.write!');
4
system.stdout.writeLine('\nHello, system.stdout.writeLine!');
5
6
system.stderr.write('Hello, system.stderr.write!');
7
system.stderr.writeLine('\nHello, system.stderr.writeLine!');
8
9
system.stdout.writeLine('system.stdin.readLine(): ');
10
var line = system.stdin.readLine();
11
system.stdout.writeLine(JSON.stringify(line));
12
13
// This is essentially a `readAll`
14
system.stdout.writeLine('system.stdin.read(5): (ctrl+D to end)');
15
var input = system.stdin.read(5);
16
system.stdout.writeLine(JSON.stringify(input));
17
18
phantom.exit(0);
19
20