summaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.coffee
blob: 60723e01c66f5a8857a524e85e9a753c8b3950f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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(): '
line = system.stdin.readLine()
system.stdout.writeLine JSON.stringify line

# This is essentially a `readAll`
system.stdout.writeLine 'system.stdin.read(5): (ctrl+D to end)'
input = system.stdin.read 5
system.stdout.writeLine JSON.stringify input

phantom.exit 0