2015-04-10 10:51:00 +03:00
|
|
|
"use strict";
|
2012-12-15 15:01:36 +04:00
|
|
|
var system = require('system');
|
|
|
|
|
|
|
|
system.stdout.write('Hello, system.stdout.write!');
|
|
|
|
system.stdout.writeLine('\nHello, system.stdout.writeLine!');
|
|
|
|
|
|
|
|
system.stderr.write('Hello, system.stderr.write!');
|
|
|
|
system.stderr.writeLine('\nHello, system.stderr.writeLine!');
|
|
|
|
|
|
|
|
system.stdout.writeLine('system.stdin.readLine(): ');
|
|
|
|
var line = system.stdin.readLine();
|
|
|
|
system.stdout.writeLine(JSON.stringify(line));
|
|
|
|
|
|
|
|
// This is essentially a `readAll`
|
2012-12-18 10:23:26 +04:00
|
|
|
system.stdout.writeLine('system.stdin.read(5): (ctrl+D to end)');
|
|
|
|
var input = system.stdin.read(5);
|
2012-12-15 15:01:36 +04:00
|
|
|
system.stdout.writeLine(JSON.stringify(input));
|
|
|
|
|
|
|
|
phantom.exit(0);
|