BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / phantomjs-prebuilt / lib / phantom / examples / stdin-stdout-stderr.js

stdin-stdout-stderr.js

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
stdin-stdout-stderr.js 616 B Download Raw
1"use strict";
2var system = require('system');
3
4system.stdout.write('Hello, system.stdout.write!');
5system.stdout.writeLine('\nHello, system.stdout.writeLine!');
6
7system.stderr.write('Hello, system.stderr.write!');
8system.stderr.writeLine('\nHello, system.stderr.writeLine!');
9
10system.stdout.writeLine('system.stdin.readLine(): ');
11var line = system.stdin.readLine();
12system.stdout.writeLine(JSON.stringify(line));
13
14// This is essentially a `readAll`
15system.stdout.writeLine('system.stdin.read(5): (ctrl+D to end)');
16var input = system.stdin.read(5);
17system.stdout.writeLine(JSON.stringify(input));
18
19phantom.exit(0);